IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23819


Ignore:
Timestamp:
Apr 11, 2009, 7:40:38 AM (17 years ago)
Author:
eugene
Message:

fixed naming of time formats; accepting some old versions, but made the standard names more neutral

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/concepts/pmConceptsStandard.c

    r23626 r23819  
    3636// Format type for time
    3737typedef enum {
    38     TIME_FORMAT_ISO,                    // Date stored ISO (YYYY-MM-DD)
    39     TIME_FORMAT_BACKWARDS,              // Date stored backwards (DD-MM-YYYY)
    40     TIME_FORMAT_USA,                    // Date stored in USA order (MM-DD-YYYY)
    41     TIME_FORMAT_JD,                     // Date stored as JD
    42     TIME_FORMAT_MJD,                    // Date stored as MJD
     38  TIME_FORMAT_YYYYMMDD,                 // Date stored in YYYY-MM-DD order (ISO-standard)
     39  TIME_FORMAT_DDMMYYYY,                 // Date stored in DD-MM-YYYY order
     40  TIME_FORMAT_MMDDYYYY,                 // Date stored in MM-DD-YYYY order
     41  TIME_FORMAT_JD,                       // Date stored as JD
     42  TIME_FORMAT_MJD,                      // Date stored as MJD
    4343} conceptTimeFormatType;
    4444
     
    651651{
    652652    conceptTimeFormat time;               // Time format, to return
    653     time.format = TIME_FORMAT_ISO;
     653    time.format = TIME_FORMAT_YYYYMMDD;
    654654    time.separate = false;
    655655    time.pre2000 = false;
     
    665665                if (strcasecmp(format, "SEPARATE") == 0) {
    666666                    time.separate = true;
     667                } else if (strcasecmp(format, "YYYYMMDD") == 0) {
     668                    time.format = TIME_FORMAT_YYYYMMDD;
     669                } else if (strcasecmp(format, "MMDDYYYY") == 0) {
     670                    time.format = TIME_FORMAT_MMDDYYYY;
     671                } else if (strcasecmp(format, "DDMMYYYY") == 0) {
     672                    time.format = TIME_FORMAT_DDMMYYYY;
     673                } else if (strcasecmp(format, "ISO") == 0) {
     674                    time.format = TIME_FORMAT_YYYYMMDD;
     675                } else if (strcasecmp(format, "YEAR.FIRST") == 0) {
     676                    time.format = TIME_FORMAT_YYYYMMDD;
    667677                } else if (strcasecmp(format, "USA") == 0) {
    668                     time.format = TIME_FORMAT_USA;
     678                    time.format = TIME_FORMAT_MMDDYYYY;
    669679                } else if (strcasecmp(format, "BACKWARDS") == 0) {
    670                     time.format = TIME_FORMAT_BACKWARDS;
     680                    time.format = TIME_FORMAT_DDMMYYYY;
    671681                } else if (strcasecmp(format, "PRE2000") == 0) {
    672682                    time.pre2000 = true;
     
    824834          }
    825835          switch (timeFormat.format) {
    826             case TIME_FORMAT_BACKWARDS: {
     836            case TIME_FORMAT_DDMMYYYY: {
    827837                // Need to switch days and years
    828838                int temp = day;
     
    831841                break;
    832842            }
    833             case TIME_FORMAT_USA: {
     843            case TIME_FORMAT_MMDDYYYY: {
    834844                // Need to switch everything around.... Yanks!
    835845                int temp = day;
     
    901911                break;
    902912            }
    903             case TIME_FORMAT_ISO: {
    904                 // It's ISO
     913            case TIME_FORMAT_YYYYMMDD: {
     914                // this is ISO-standard
    905915                time = psTimeFromISO(timeString, timeSys);
    906916                break;
     
    12581268
    12591269        switch (timeFormat.format) {
    1260           case TIME_FORMAT_BACKWARDS: {
     1270          case TIME_FORMAT_DDMMYYYY: {
    12611271              int day, month, year;
    12621272              psTrace ("psModules.concepts", 5, "ISO time has year first, convert to DD-MM-YYYY");
     
    12661276              break;
    12671277          }
    1268           case TIME_FORMAT_USA: {
     1278          case TIME_FORMAT_MMDDYYYY: {
    12691279              int day, month, year;
    12701280              psTrace ("psModules.concepts", 5, "ISO time has year first, convert to MM-DD-YYYY");
Note: See TracChangeset for help on using the changeset viewer.