Changeset 3949


Ignore:
Timestamp:
27/05/08 14:33:13 (11 years ago)
Author:
domlowe
Message:

python datetime does not handle year 0000, so replacing with calls to cdtime

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml/csmllibs/csmlextra.py

    r3917 r3949  
    11#Stuff with nowhere better to go 
    2 import random, datetime 
     2import random 
    33import string 
    44import csml.parser 
    55import os, sys 
     6import cdtime 
    67 
    78def getRandomID(): 
     
    4243 
    4344def strToDate(ymd): 
    44     '''given a string in form '2006-01-01' returns a datetime object''' 
    45     return datetime.date(*map(int, ymd.split('-'))) 
     45    '''given a string in form '2006-01-01' returns a cdtime object''' 
     46    return cdtime.comptime(*map(int, ymd.split(' ')[0].split('-'))) 
    4647 
    4748class EnvelopeAggregator(object): 
Note: See TracChangeset for help on using the changeset viewer.