how to store a date in a file with mxDateTime

Scott Hathaway slhath at home.com
Mon May 14 23:10:47 EDT 2001


David,

Thanks.  I am using the default string format for DateTime (without any
alterations), but it doesn't work.

I am using the newest mxDateTime (2.x).

Thanks,
Scott

"David Bolen" <db3l at fitlinxx.com> wrote in message
news:uk83jpn1h.fsf at ctwd0143.fitlinxx.com...
> "Scott Hathaway" <slhath at home.com> writes:
>
> > I have tried the RelativeDateFrom(fileFromDate) method and
> > DateTimeFrom(fileFromDate) method without success.
>
> Converting the timestamp in your file to a DateTime value with
> DateTimeFrom is sort of the "right" way to go, but older DateTime
> versions (up until it switched to mx.DateTime) aren't as flexible as
> they might be in parsing strings.  In particular, I think we had
> problems with the US-standard approach of MM/DD/YY with two digit
> years.  So depending on your format you might need to experiment a
> little to see if you need to add some preprocessing.
>
> You could of course build your own parser, but we've generally found
> it easier to just augment our input if it's a well defined deficiency
> (such as adding the leading 2 digits to years) and then use
> DateTimeFrom.  You can experiment interactively with your string
> formats to see just what parses the most accurately.
>
> I do believe that in the 2.x releases (mx.DateTime) the parsing
> function has been bolstered quite a bit and can handle more variety of
> input.
>
> --
> -- David
> --
> /-----------------------------------------------------------------------\
>  \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
>   |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
>  /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
> \-----------------------------------------------------------------------/





More information about the Python-list mailing list