maybe useful : datetime conversion

Stef Mientki stef.mientki at gmail.com
Fri May 20 14:27:56 EDT 2011


hello,

using datetimes from a lot of different sources,
in many languages,
I had about 30 python helper routines,
which I now packed in one class,
much simpler.
Although I used the Delphi date-format as the base,
it shouldn't be difficult to rewrite the class for another type.

The input can be one of the following types :
  - None            : the current date-time is used
  - 30000.9         : a Delphi datetime
  - 30000           : a Delphi datetime
  - "30000.9"       : a Delphi datetime as a string
  - "30000,9"       : a Delphi datetime as a (Dutch) string
  - "20-5-11"              : short year notation
  - "20-05-2011"           : long year notation
  - "2009-09-24 10:12:24"  : Access string
  - datetime.datetime ( 2011, 1, 15 )
  - time.struct_time
  - wx.DateTime
  - time.time()  (through method from_time)

Maybe someone can use it.

cheers,
Stef


-------------- next part --------------
A non-text attachment was scrubbed...
Name: module1.py
Type: text/x-python
Size: 4880 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20110520/9c7634d8/attachment.py>


More information about the Python-list mailing list