Index: /trunk/psLib/src/astro/psTime.c
===================================================================
--- /trunk/psLib/src/astro/psTime.c	(revision 19736)
+++ /trunk/psLib/src/astro/psTime.c	(revision 19737)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.115 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-03-17 23:53:43 $
+ *  @version $Revision: 1.116 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-09-24 20:04:32 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1532,10 +1532,16 @@
     psTime *outTime = psTimeStrptime(input, "%Y-%m-%dT%H:%M:%S");
     if (!outTime) {
+        // Try without the middle 'T'
+        outTime = psTimeStrptime(input, "%Y-%m-%d %H:%M:%S");
+    }
+    if (!outTime) {
         // 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;
-        }
+    }
+    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;
     }
 
@@ -1742,19 +1748,16 @@
     char *lastChar = strptime(s, format, &tmTime);
     if (!lastChar) {
-        psError(PS_ERR_UNKNOWN, true, "error parsing time string");
+        // No error because this function is called repeatedly as a test.
+        // Returning NULL without an error is fine, since we're just saying that it's not readable.
         return NULL;
     }
 
+    // strptime cannot handle fractional seconds, so we do that ourselves
     if (*lastChar != '\0') {
-        psTrace("psLib.astro", 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);
+            char *reallyLast;           // The real last part of the string
+            fractionalSeconds = strtod(lastChar, &reallyLast);
             if (!reallyLast) {
-                psWarning("time string was not completely consumed\n");
+                psWarning("Time string was not completely consumed");
             }
         }
