Index: trunk/psLib/src/astro/psTime.c
===================================================================
--- trunk/psLib/src/astro/psTime.c	(revision 8627)
+++ trunk/psLib/src/astro/psTime.c	(revision 8772)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.94 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-26 04:34:27 $
+ *  @version $Revision: 1.95 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-09-08 00:30:03 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1490,7 +1490,4 @@
                       psTimeType type)
 {
-    psS32 millisecond;
-    struct tm tmTime;
-    psTime *outTime = NULL;
 
     // Check for NULL string
@@ -1498,29 +1495,10 @@
     PS_ASSERT_INT_WITHIN_RANGE(type, PS_TIME_TAI, PS_TIME_TT, NULL);
 
-    // Convert YYYY-MM-DDThh:mm:ss.sss in string form to tm time
-    if (sscanf(input, "%d-%d-%dT%d:%d:%d.%d", &tmTime.tm_year, &tmTime.tm_mon, &tmTime.tm_mday,
-               &tmTime.tm_hour, &tmTime.tm_min, &tmTime.tm_sec,&millisecond) < 7) {
+    // Convert YYYY-MM-DDThh:mm:ss.sss[Z] in string form to tm time
+    psTime *outTime = psTimeStrptime(input, "%Y-%m-%dT%H:%M:%S");
+
+    if (!outTime) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Specified ISO Time string, '%s', is malformed.  Must be in 'YYYY-MM-DDThh:mm:ss.sss' format."), input);
         return NULL;
-    }
-
-    PS_ASSERT_INT_NONNEGATIVE(tmTime.tm_year, outTime);
-    PS_ASSERT_INT_WITHIN_RANGE(tmTime.tm_mon,1,12,outTime);
-    PS_ASSERT_INT_WITHIN_RANGE(tmTime.tm_mday,1,31,outTime);
-    PS_ASSERT_INT_WITHIN_RANGE(tmTime.tm_hour,0,23,outTime);
-    PS_ASSERT_INT_WITHIN_RANGE(tmTime.tm_min,0,59,outTime);
-    PS_ASSERT_INT_WITHIN_RANGE(tmTime.tm_sec,0,59,outTime);
-    PS_ASSERT_INT_WITHIN_RANGE(millisecond,0,999,outTime);
-
-    tmTime.tm_year -= 1900;
-    tmTime.tm_mon--;
-    tmTime.tm_isdst = -1;
-
-    // Convert tm time to psTime
-    outTime = psTimeFromTM(&tmTime);
-    outTime->nsec = millisecond * 1000000;
-    //    outTime->type = type;
-    if (type != PS_TIME_TAI) {
-        outTime = psTimeConvert(outTime, type);
     }
 
@@ -1662,5 +1640,5 @@
 
     struct tm tmTime;
-    char *lastChar = strptime((char *)s, "%EY-%m-%d%t%T", &tmTime);
+    char *lastChar = strptime(s, format, &tmTime);
     if (!lastChar) {
         psError(PS_ERR_UNKNOWN, true, "error parsing time string");
