Changeset 2538 in lmdz_wrf for trunk


Ignore:
Timestamp:
May 17, 2019, 4:56:18 AM (6 years ago)
Author:
lfita
Message:

Adding CFtime format [YYYY]-[MM]-[DD]T[HH]:[MM]:[SS] in `fromanydate_CFYmd'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r2532 r2538  
    567567    >>> fromanydate_CFYmd('1976-02-17_08:32:27')
    568568    '1976-02-17'
     569    >>> fromanydate_CFYmd('1976-02-17T08:32:27Z')
     570    '1976-02-17'
    569571    """
    570572    fname = 'fromanydate_CFYmd'
     
    582584    # Removing possible [datre]_[time]
    583585    if date.count('_') != 0: date = date.split('_')[0]
     586    if date.count('T') != 0: date = date.split('T')[0]
    584587
    585588    ldate = date.split('-')
     
    597600
    598601    return newdate
     602
     603print fromanydate_CFYmd('1976-02-17T08:32:27Z')
     604quit()
     605
    599606
    600607class CFtimeU_inf(object):
Note: See TracChangeset for help on using the changeset viewer.