Index: trunk/psLib/src/astro/psTime.c
===================================================================
--- trunk/psLib/src/astro/psTime.c	(revision 14077)
+++ trunk/psLib/src/astro/psTime.c	(revision 17023)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.114 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-07-09 20:11:29 $
+ *  @version $Revision: 1.115 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-03-17 23:53:43 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1545,4 +1545,61 @@
 }
 
+// accepts a range of human readable times:
+// ISO (YYYY-MM-MMTHH:MM:SS[.sss][Z])
+// YYYY/MM/DD,HH:MM:DD
+psTime* psTimeFromString(const char *input,
+                      psTimeType type)
+{
+
+    // Check for NULL string
+    PS_ASSERT_PTR_NON_NULL(input,NULL);
+    PS_ASSERT_INT_WITHIN_RANGE(type, PS_TIME_TAI, PS_TIME_TT, NULL);
+
+    psTime *outTime = NULL;
+
+    // Convert YYYY-MM-DDThh:mm:ss.sss[Z] in string form to tm time
+    outTime = psTimeStrptime(input, "%Y-%m-%dT%H:%M:%S");
+    if (outTime) {
+      outTime->type = type;
+      return outTime;
+    }
+    psErrorClear ();
+
+    // Convert YYYY/MM/DD,hh:mm:ss.sss[Z] in string form to tm time
+    outTime = psTimeStrptime(input, "%Y/%m/%d,%H:%M:%S");
+    if (outTime) {
+      outTime->type = type;
+      return outTime;
+    }
+    psErrorClear ();
+
+    // Convert YYYY/MM/DD@hh:mm:ss.sss[Z] in string form to tm time
+    outTime = psTimeStrptime(input, "%Y/%m/%d@%H:%M:%S");
+    if (outTime) {
+      outTime->type = type;
+      return outTime;
+    }
+    psErrorClear ();
+
+    // try for date with assumed 00:00:00 time
+    outTime = psTimeStrptime(input, "%Y-%m-%d");
+    if (outTime) {
+      outTime->type = type;
+      return outTime;
+    }
+    psErrorClear ();
+
+    // try for date with assumed 00:00:00 time
+    outTime = psTimeStrptime(input, "%Y/%m/%d");
+    if (outTime) {
+      outTime->type = type;
+      return outTime;
+    }
+    psErrorClear ();
+
+    psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Specified Time string, '%s', is malformed.  Must be in 'YYYY-MM-DDThh:mm:ss.sss' format."), input);
+    return NULL;
+}
+
 psTime* psTimeFromTT(psS64 sec,
                      psU32 nsec)
