Index: trunk/psLib/src/astro/psTime.c
===================================================================
--- trunk/psLib/src/astro/psTime.c	(revision 10122)
+++ trunk/psLib/src/astro/psTime.c	(revision 10736)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.106 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-11-21 19:23:02 $
+ *  @version $Revision: 1.107 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-12-14 23:02:46 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -25,4 +25,5 @@
 #include "psError.h"
 #include "psLogMsg.h"
+#include "psTrace.h"
 #include "psMemory.h"
 #include "psAbort.h"
@@ -1498,6 +1499,10 @@
     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;
+        // try for date with assumed 00:00:00 time
+        outTime = psTimeStrptime(input, "%Y-%m-%d");
+        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;
+        }
     }
 
@@ -1640,5 +1645,9 @@
     PS_ASSERT_PTR_NON_NULL(format, NULL);
 
+    double fractionalSeconds = 0.0;
+
     struct tm tmTime;
+    tmTime.tm_year = tmTime.tm_mon = tmTime.tm_mday = 0;
+    tmTime.tm_hour = tmTime.tm_min = tmTime.tm_sec = 0;
     char *lastChar = strptime(s, format, &tmTime);
     if (!lastChar) {
@@ -1648,5 +1657,16 @@
 
     if (*lastChar != '\0') {
-        psWarning("time string was not completely consumed\n");
+        psTrace("psLib.astrom", 3, "handling fractional second in time string\n");
+        // XXXXXXXXXXXXXXX
+        // XXX this is a really stupid error:
+        // we are dropping the fractional seconds with this conversion
+        // I've put in a proposed fix, but PLEASE test!!!
+        if (*lastChar == '.') {
+            char *reallyLast;
+            fractionalSeconds = strtod (lastChar, &reallyLast);
+            if (!reallyLast) {
+                psWarning("time string was not completely consumed\n");
+            }
+        }
     }
 
@@ -1657,4 +1677,5 @@
     }
 
+    time->nsec += fractionalSeconds * 1e9;
     return time;
 }
