Index: /trunk/psModules/src/concepts/pmConceptsStandard.c
===================================================================
--- /trunk/psModules/src/concepts/pmConceptsStandard.c	(revision 11357)
+++ /trunk/psModules/src/concepts/pmConceptsStandard.c	(revision 11358)
@@ -429,4 +429,5 @@
 
     // Work out how the time is represented
+    bool separateTime = false;
     bool usaTime = false;               // Is the time specified in USA (MM-DD-YYYY) order?
     bool backwardsTime = false;         // Is the time specified in backwards (DD-MM-YYYY) order?
@@ -454,5 +455,7 @@
     psListIterator *timeFormatsIter = psListIteratorAlloc(timeFormats, PS_LIST_HEAD, false); // Iter
     while ((timeFormat = psListGetAndIncrement(timeFormatsIter))) {
-        if (strcasecmp(timeFormat, "USA") == 0) {
+        if (strcasecmp(timeFormat, "SEPARATE") == 0) {
+            separateTime = true;
+        } else if (strcasecmp(timeFormat, "USA") == 0) {
             usaTime = true;
             backwardsTime = false;
@@ -500,4 +503,7 @@
     switch (concept->type) {
     case PS_DATA_LIST: {
+            if (!separateTime) {
+                psWarning ("DATE and TIME stored separately, but not specified in format\n");
+            }
             // The date and time are stored separately
             // Assume the date is first and the time second
@@ -836,4 +842,5 @@
     bool jdTime = false;                // Is the date stored as a JD?
     bool mjdTime = false;               // Is the date stored as a MJD?
+    bool yearFirst = false;
 
     bool mdok = true;                   // Status of MD lookup
@@ -847,6 +854,9 @@
                 if (strcasecmp(format, "SEPARATE") == 0) {
                     separateTime = true;
-                } else if (strcasecmp(format, "PRE2000") == 0) {
-                    pre2000Time = true;
+                } else if (strcasecmp(format, "USA") == 0) {
+                    usaTime = true;
+                    backwardsTime = false;
+                    jdTime = false;
+                    mjdTime = false;
                 } else if (strcasecmp(format, "BACKWARDS") == 0) {
                     backwardsTime = true;
@@ -854,9 +864,18 @@
                     mjdTime = false;
                     jdTime = false;
-                } else if (strcasecmp(format, "USA") == 0) {
-                    usaTime = true;
+                } else if (strcasecmp(format, "YEAR.FIRST") == 0) {
+                    yearFirst = true;
+                    usaTime = false;
                     backwardsTime = false;
                     jdTime = false;
                     mjdTime = false;
+                } else if (strcasecmp(format, "PRE2000") == 0) {
+                    pre2000Time = true;
+                } else if (strcasecmp(format, "MJD") == 0) {
+                    mjdTime = true;
+                    usaTime = false;
+                    backwardsTime = false;
+                    jdTime = false;
+                    separateTime = false;
                 } else if (strcasecmp(format, "JD") == 0) {
                     jdTime = true;
@@ -864,10 +883,4 @@
                     backwardsTime = false;
                     mjdTime = false;
-                    separateTime = false;
-                } else if (strcasecmp(format, "MJD") == 0) {
-                    mjdTime = true;
-                    usaTime = false;
-                    backwardsTime = false;
-                    jdTime = false;
                     separateTime = false;
                 } else {
@@ -896,10 +909,19 @@
         }
         if (backwardsTime) {
-            psError(PS_ERR_UNKNOWN, true, "You want it BACKWARDS?  Not right now, thanks.\n");
-            return NULL;
+            int day, month, year;
+            psTrace ("psModules.concepts", 5, "ISO time has year first, convert to DD-MM-YYYY");
+            sscanf (dateString, "%d-%d-%d", &year, &month, &day);
+            sprintf (dateString, "%02d-%02d-%04d", day, month, year);
+            // XXX fix this for str length
         }
         if (usaTime) {
-            psError(PS_ERR_UNKNOWN, true, "USA?  No OK.\n");
-            return NULL;
+            int day, month, year;
+            psTrace ("psModules.concepts", 5, "ISO time has year first, convert to MM-DD-YYYY");
+            sscanf (dateString, "%d-%d-%d", &year, &month, &day);
+            sprintf (dateString, "%02d-%02d-%04d", month, day, year);
+            // XXX fix this for str length
+        }
+        if (yearFirst) {
+            psTrace ("psModules.concepts", 5, "ISO time has year first, no adjustment needed");
         }
 
@@ -908,9 +930,8 @@
         psMetadataItem *timeItem = psMetadataItemAllocStr(concept->name, "The time of observation",
                                    timeString);
-        psFree(dateString);
-        psFree(timeString);
 
         psListRemove(dateTime, PS_LIST_HEAD);
         psListRemove(dateTime, PS_LIST_HEAD);
+
         psListAdd(dateTime, PS_LIST_HEAD, dateItem);
         psListAdd(dateTime, PS_LIST_TAIL, timeItem);
@@ -918,4 +939,7 @@
         psMetadataItem *item = psMetadataItemAllocPtr(concept->name, PS_DATA_LIST, concept->comment,
                                dateTime);
+        psFree (dateItem);
+        psFree (timeItem);
+        psFree (dateTime);
         return item;
     }
