<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I really can't quite fathom why you'd want to use something so low-level as time.mktime... or just about anything in the time module :)<br>
</blockquote></div>
I didn't know anything better,<br>
but (forgive me if I'm wrong) I find mx almost as low-level :<br>
>>> mx.DateTime.strptime('01-01-53',"%d-%m-%y")<br>
<mx.DateTime.DateTime object for '2053-01-01 00:00:00.00' at 1cddc60><br>
while all we human know ..<br>
<br>
I agree it's better not to work with string dates, but that's the way how we human write things down ;-)<br>
So I must use at least something like strptime.<br></blockquote><div><br></div><div>mx.DateTime provides all the low-level tools if you must use them of course, but it has high level tools too. </div><div><br></div><div>

<div>>>> mx.DateTime.Parser.DateFromString("01-01-1953")</div><div><mx.DateTime.DateTime object for '1953-01-01 00:00:00.00' at 6211e0></div><div><br></div><div>Now if you're storing your years as 2-digits, yeah, it'll run into trouble and you'll have to deal with issues related to that manually. It can't know by default if you mean 01-01-53 as someone's birthdate in 1953, or some future event in 2053.</div>

<div><br></div><div>It also parses the common "standardized" date representations (and faster if its a known format, as mx.DateTime.Parser has to guess at the format until it finds one that matches/works)-- ISO 8601 and the ARPA formats, for example. The mx.DateTime.ISO and mx.DateTime.ARPA modules are for that.</div>

<div><br></div><div>Personally, while /users/ may write a date in a lazy way like "01-01-53", I'd never store that and would avoid having them enter them directly. At the UI level I'd validate and normalize it to a standard format before storing it.</div>

<div><br></div><div>E.g. instead of users entering someone's birthday into a control, I'd use a calendar control, and store it with (in wx terms) date.FormatISODate(). Or use date.toString(ISODate) in QT terms (ish).</div>

<div><br></div><div>I might not display it in ISO format, but.. storing it in a standard format makes processing easier. Faster to import into mx.DateTime, and then I just display it as dt.Format("%x") so they see a date like they expect.</div>

<div><br></div><div>HTH,</div><div><br></div><div>--S</div></div></div>