mxDateTime package question
Steve Holden
steve at holdenweb.com
Tue Oct 12 21:00:42 EDT 2004
More information about the Python-list mailing list
Tue Oct 12 21:00:42 EDT 2004
- Previous message (by thread): PIL question - saving JPEG
- Next message (by thread): mxDateTime package question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Prashant Pai wrote: > I have a Julian (?) date string '2000238' (format YYYYDDD) which > corresponds to 2000/08/25 > > How do I create a correct DateTime object with this? > > thanks You could try >>> jd = "2000238" >>> y = int(jd[:4]) >>> d = int(jd[4:])-1 >>> yd = mx.DateTime.DateTime(y) >>> dinc = mx.DateTime.DateTimeDeltaFromDays(d) >>> result = yd+dinc >>> result <DateTime object for '2000-08-25 00:00:00.00' at a0d4620> >>> but there may well be more efficient ways. regards Steve -- http://www.holdenweb.com http://pydish.holdenweb.com Holden Web LLC +1 800 494 3119
- Previous message (by thread): PIL question - saving JPEG
- Next message (by thread): mxDateTime package question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list