Index: /trunk/psLib/src/astro/psCoord.c
===================================================================
--- /trunk/psLib/src/astro/psCoord.c	(revision 1614)
+++ /trunk/psLib/src/astro/psCoord.c	(revision 1615)
@@ -3,5 +3,5 @@
 *  @brief Contains basic coordinate transformation definitions and operations
 *
-*  This file defines the basic types for astronomical coordinate 
+*  This file defines the basic types for astronomical coordinate
 *  transformation
 *
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-13 23:43:29 $
+*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-25 01:38:30 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -196,5 +196,5 @@
 psSphereTransform* psSphereTransformICRStoEcliptic(psTime time)
 {
-    struct tm *tmTime = psTimeToTM(time);
+    struct tm *tmTime = psTimeToTM(&time);
     double year = (double)(1900 + tmTime->tm_year);
     double T = year / 100.0;
@@ -208,5 +208,5 @@
 psSphereTransform* psSphereTransformEcliptictoICRS(psTime time)
 {
-    struct tm *tmTime = psTimeToTM(time);
+    struct tm *tmTime = psTimeToTM(&time);
     double year = (double)(1900 + tmTime->tm_year);
     double T = year / 100.0;
Index: /trunk/psLib/src/astronomy/psCoord.c
===================================================================
--- /trunk/psLib/src/astronomy/psCoord.c	(revision 1614)
+++ /trunk/psLib/src/astronomy/psCoord.c	(revision 1615)
@@ -3,5 +3,5 @@
 *  @brief Contains basic coordinate transformation definitions and operations
 *
-*  This file defines the basic types for astronomical coordinate 
+*  This file defines the basic types for astronomical coordinate
 *  transformation
 *
@@ -10,6 +10,6 @@
 *  @author George Gusciora, MHPCC
 *
-*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-13 23:43:29 $
+*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-25 01:38:30 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -196,5 +196,5 @@
 psSphereTransform* psSphereTransformICRStoEcliptic(psTime time)
 {
-    struct tm *tmTime = psTimeToTM(time);
+    struct tm *tmTime = psTimeToTM(&time);
     double year = (double)(1900 + tmTime->tm_year);
     double T = year / 100.0;
@@ -208,5 +208,5 @@
 psSphereTransform* psSphereTransformEcliptictoICRS(psTime time)
 {
-    struct tm *tmTime = psTimeToTM(time);
+    struct tm *tmTime = psTimeToTM(&time);
     double year = (double)(1900 + tmTime->tm_year);
     double T = year / 100.0;
Index: /trunk/psLib/test/astronomy/tst_psTime_01.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psTime_01.c	(revision 1614)
+++ /trunk/psLib/test/astronomy/tst_psTime_01.c	(revision 1615)
@@ -21,6 +21,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-08-06 22:34:05 $
+ *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-08-25 01:38:42 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -34,16 +34,19 @@
 int main(int argc, char* argv[])
 {
-    psTime time;
-    psTime testTime;
-    char *testString = "2004/07/21,18:22:24.272";
+    psTime *time;
+    psTime *testTime;
+    char *testString = "2004-07-21T18:22:24.272Z";
+    time = (psTime*)psAlloc(sizeof(psTime));
 
     // Test time was taken at July 21, 2004 at 18:22:24.272044
-    testTime.tv_sec = 1090434144;
-    testTime.tv_usec = 272044;
+    testTime = (psTime*)psAlloc(sizeof(psTime));
+    testTime->sec = 1090434144;
+    testTime->usec = 272044;
+    testTime->type = PS_TIME_TAI;
 
 
     // Test A - Get current TAI time
     printPositiveTestHeader(stdout,"psTime", "Get current TAI time");
-    time = psTimeGetTime();
+    time = psTimeGetTime(PS_TIME_TAI);
     printFooter(stdout, "psTime", "Get current TAI time", true);
 
@@ -51,5 +54,5 @@
     //Test B - Print test time
     printPositiveTestHeader(stdout,"psTime", "Print test time");
-    printf("Test time: Seconds = %ld Microseconds = %ld\n", (long)testTime.tv_sec, (long)testTime.tv_usec);
+    printf("Test time: Seconds = %ld Microseconds = %ld\n", (long)testTime->sec, (long)testTime->usec);
     printFooter(stdout, "psTime", "Print test time", true);
 
@@ -70,13 +73,13 @@
     printPositiveTestHeader(stdout,"psTime", "Convert ISO time to psTime");
     time = psISOToTime(isoString);
-    printf("psTime: Seconds = %ld Microseconds = %ld\n", (long)time.tv_sec, (long)time.tv_usec);
+    printf("psTime: Seconds = %lld Microseconds = %d\n", (psS64)time->sec, (psU32)time->usec);
     psFree(isoString);
     printFooter(stdout, "psTime", "Convert ISO time to psTime", true);
 
 
-    // Test E - Convert psTime to UTC time
+    // Test E - Convert TAI to UTC time
     printPositiveTestHeader(stdout,"psTime", "Convert psTime time to UTC time");
-    time = psTimeToUTC(testTime);
-    printf("psTime: Seconds = %ld Microseconds = %ld\n", (long)time.tv_sec, (long)time.tv_usec);
+    time = psTimeConvert(testTime, PS_TIME_UTC);
+    printf("psTime: Seconds = %lld Microseconds = %d\n", (psS64)time->sec, (psU32)time->usec);
     printFooter(stdout, "psTime", "Convert psTime time to UTC time", true);
 
@@ -84,6 +87,7 @@
     // Test F - Convert UTC time to psTime
     printPositiveTestHeader(stdout,"psTime", "Convert UTC time to psTime");
-    time = psUTCToTime(time);
-    printf("psTime: Seconds = %ld Microseconds = %ld\n", (long)time.tv_sec, (long)time.tv_usec);
+    time->type = PS_TIME_UTC;
+    time = psTimeConvert(time, PS_TIME_TAI);
+    printf("psTime: Seconds = %lld Microseconds = %d\n", (psS64)time->sec, (psU32)time->usec);
     printFooter(stdout, "psTime", "Convert UTC time to psTime", true);
 
@@ -100,5 +104,5 @@
     printPositiveTestHeader(stdout,"psTime", "Convert MJD time to psTime");
     time = psMJDToTime(mjdTime);
-    printf("psTime: Seconds = %ld Microseconds = %ld\n", (long)time.tv_sec, (long)time.tv_usec);
+    printf("psTime: Seconds = %lld Microseconds = %d\n", (psS64)time->sec, (psU32)time->usec);
     printFooter(stdout, "psTime", "Convert MJD time to psTime", true);
 
@@ -115,5 +119,5 @@
     printPositiveTestHeader(stdout,"psTime", "Convert JD time to psTime");
     time = psJDToTime(jdTime);
-    printf("psTime: Seconds = %ld Microseconds = %ld\n", (long)time.tv_sec, (long)time.tv_usec);
+    printf("psTime: Seconds = %lld Microseconds = %d\n", (psS64)time->sec, (psU32)time->usec);
     printFooter(stdout, "psTime", "Convert JD time to psTime", true);
 
@@ -130,5 +134,5 @@
     printPositiveTestHeader(stdout,"psTime", "Convert timeval time to psTime");
     time = psTimevalToTime(&timevalTime);
-    printf("psTime: Seconds = %ld Microseconds = %ld\n", (long)time.tv_sec, (long)time.tv_usec);
+    printf("psTime: Seconds = %lld Microseconds = %d\n", (psS64)time->sec, (psU32)time->usec);
     printFooter(stdout, "psTime", "Convert timeval time to psTime", true);
 
@@ -151,5 +155,5 @@
     printPositiveTestHeader(stdout, "psTime", "Convert tm time to psTime");
     time = psTMToTime(tmTime);
-    printf("psTime: Seconds = %ld Microseconds = %ld\n", (long)time.tv_sec, (long)time.tv_usec);
+    printf("psTime: Seconds = %lld Microseconds = %d\n", (psS64)time->sec, (psU32)time->usec);
     printFooter(stdout, "psTime", "Convert tm time to psTime", true);
 
Index: /trunk/psLib/test/astronomy/tst_psTime_02.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psTime_02.c	(revision 1614)
+++ /trunk/psLib/test/astronomy/tst_psTime_02.c	(revision 1615)
@@ -4,15 +4,11 @@
  *
  *  This test driver contains the following tests for psTime:
- *     A) Attempt to use negative seconds
- *     B) Attempt to use negative microseconds
- *     C) Attempt to use negative time
- *     D) Incorrect ISO time data
- *     E) Attempt to use null timeval
- *     F) Incorrect timeval time data
+ *     A) Incorrect ISO time data
+ *     B) Attempt to use null timeval
  *
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-08-06 22:34:05 $
+ *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-08-25 01:38:48 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -25,65 +21,17 @@
 int main(int argc, char* argv[])
 {
-    psTime testTime;
-    struct timeval timevalTime;
 
-
-    // Test A - Attempt to use negative seconds
-    testTime.tv_sec = -1;
-    testTime.tv_usec = 1;
-    timevalTime.tv_sec = -1;
-    timevalTime.tv_usec = 1;
-    printNegativeTestHeader(stdout,"psTime", "Attempt to use negative seconds",
-                            "Negative seconds are not allowed: -1", 0);
-    psTimeToISO(testTime);
-    psTimeToUTC(testTime);
-    psUTCToTime(testTime);
-    psTimeToMJD(testTime);
-    psTimeToJD(testTime);
-    psTimeToTimeval(testTime);
-    psTimevalToTime(&timevalTime);
-    psTimeToTM(testTime);
-    printFooter(stdout, "psTime", "Attempt to use negative seconds", true);
-
-
-    // Test B - Attempt to use negative microseconds
-    testTime.tv_sec = 1;
-    testTime.tv_usec = -1;
-    timevalTime.tv_sec = 1;
-    timevalTime.tv_usec = -1;
-    printNegativeTestHeader(stdout,"psTime", "Attempt to use negative microseconds",
-                            "Negative microseconds are not allowed: -1", 0);
-    psTimeToISO(testTime);
-    psTimeToUTC(testTime);
-    psUTCToTime(testTime);
-    psTimeToMJD(testTime);
-    psTimeToJD(testTime);
-    psTimeToTimeval(testTime);
-    psTimevalToTime(&timevalTime);
-    psTimeToTM(testTime);
-    printFooter(stdout, "psTime", "Attempt to use negative microseconds", true);
-
-
-    // Test C - Attempt to use negative time
-    printNegativeTestHeader(stdout,"psTime", "Attempt to use negative time",
-                            "Negative time is not allowed: -1.000000", 0);
-    psJDToTime(-1.0);
-    psMJDToTime(-1.0);
-    printFooter(stdout, "psTime", "Attempt to use negative time", true);
-
-
-    // Test D - Incorrect ISO time data
+    // Test A - Incorrect ISO time data
     printNegativeTestHeader(stdout,"psTime", "Incorrect ISO time data", "Time not allowed", 0);
-    psISOToTime("1800/2/2,12:12:12.122");
-    psISOToTime("2004/-2/2,12:12:12.122");
-    psISOToTime("2004/2/-2,12:12:12.122");
-    psISOToTime("2004/2/2,-12:12:12.122");
-    psISOToTime("2004/2/2,12:-12:12.122");
-    psISOToTime("2004/2/2,12:12:-12.122");
-    psISOToTime("2004/2/2,12:12:12.-122");
+    psISOToTime("2004-99-21T18:22:24.272Z");
+    psISOToTime("2004-07-99T18:22:24.272Z");
+    psISOToTime("2004-07-21T99:22:24.272Z");
+    psISOToTime("2004-07-21T18:99:24.272Z");
+    psISOToTime("2004-07-21T18:22:99.272Z");
+    psISOToTime("2004-07-21T18:22:24.-999Z");
     printFooter(stdout, "psTime", "Incorrect ISO time data", true);
 
 
-    // Test E - Attempt to use null timeval
+    // Test B - Attempt to use null timeval
     printNegativeTestHeader(stdout,"psTime", "Attempt to use null timeval",
                             "Null value for timeval arg not allowed", 0);
@@ -91,32 +39,4 @@
     printFooter(stdout, "psTime", "Attempt to use null timeval", true);
 
-
-    // Test F - Incorrect timeval time data
-    printNegativeTestHeader(stdout,"psTime", "Incorrect timeval time data", "Time not allowed", 0);
-    struct tm tmTime;
-    tmTime.tm_year = -2;
-    tmTime.tm_mon  = 2;
-    tmTime.tm_mday = 2;
-    tmTime.tm_hour = 2;
-    tmTime.tm_min  = 2;
-    tmTime.tm_sec  = 2;
-    psTMToTime(&tmTime);
-    tmTime.tm_year = 100;
-    tmTime.tm_mon  = -2;
-    psTMToTime(&tmTime);
-    tmTime.tm_mon  = 2;
-    tmTime.tm_mday = -2;
-    psTMToTime(&tmTime);
-    tmTime.tm_hour = -2;
-    tmTime.tm_mday = 2;
-    psTMToTime(&tmTime);
-    tmTime.tm_hour = 2;
-    tmTime.tm_min = -2;
-    psTMToTime(&tmTime);
-    tmTime.tm_min = 2;
-    tmTime.tm_sec = -2;
-    psTMToTime(&tmTime);
-    printFooter(stdout, "psTime", "Incorrect timeval time data", true);
-
     return 0;
 }
