Changeset 8613 for TI01-discovery-Ingest


Ignore:
Timestamp:
05/10/12 15:31:50 (7 years ago)
Author:
sdonegan
Message:

Put in patch for better handling of dates with time zones such as those used by BGS Medin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery-Ingest/trunk/v4n_MEDIN/ingestAutomation-upgrade/OAIBatch/ExtractISO.py

    r7867 r8613  
    364364                 
    365365                 
    366                 dateStrArr = inputDate.split('-') 
     366                #nasty way of dealing with dates I know (benefit of expierience t+3 yrs now!) 
     367                #format must be either YYYY-MM-DDThh:mm:ss or YYYY-MM-DD, so 
     368                 
     369                try: 
     370                        #This should work if date string conforms to either.. 
     371                        givenDate = inputDate.split('T')[0] 
     372                except: 
     373                        return False 
     374                                 
     375                dateStrArr = givenDate.split('-') 
    367376                 
    368377                #check if long date string or short - if long, will have a T in! (should do..) 
Note: See TracChangeset for help on using the changeset viewer.