internal date format in python

Post new topic   Reply to topic Site Building View previous topic :: View next topic  
Author Message
Wiesel



Joined: 16 Aug 2005
Posts: 1

PostPosted: Tue Aug 16, 2005 10:40 am    Post subject: internal date format in python Reply with quote

Hi everybody!

For programming a maya calendar I need to check how many days away is an entered (via spot) date from a certain date. In some languages there exists an internal date format which returns an integer value of the days from a certain zero "date", in DOS e.g. 1/1/1980, or Cache 1/1/1843.
Is there such a function in Python ?
Thank you in advance,

Wiesel
Back to top
View user's profile Send private message
Studio 12
Site Admin


Joined: 04 Aug 2004
Posts: 67

PostPosted: Tue Aug 16, 2005 11:31 am    Post subject: Reply with quote

Not sure this is what you need but I found this on http://docs.python.org/lib/lib.html. there are a few sections on date and time. If you haven't poked around in there you may find them very usefully.

fromtimestamp(timestamp)
Return the local date corresponding to the POSIX timestamp, such as is returned by time.time(). This may raise ValueError, if the timestamp is out of the range of values supported by the platform C localtime() function. It's common for this to be restricted to years from 1970 through 2038. Note that on non-POSIX systems that include leap seconds in their notion of a timestamp, leap seconds are ignored by fromtimestamp().

Hope thats helpful

_________________
Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic.
Back to top
View user's profile Send private message
Lisa



Joined: 04 Aug 2004
Posts: 118
Location: Amsterdam

PostPosted: Wed Aug 17, 2005 3:03 am    Post subject: Reply with quote

This website might be helpful. It has all the time functions.
http://www.python.org/doc/2.3/lib/module-time.html
Good luck
_________________
-Lisa-
Back to top
View user's profile Send private message MSN Messenger
Studio 12
Site Admin


Joined: 04 Aug 2004
Posts: 67

PostPosted: Wed Aug 17, 2005 1:22 pm    Post subject: Reply with quote

URL Correction
Oops, I posted the wrong URL. This would be the correct one.

http://docs.python.org/lib/

_________________
Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic All times are GMT - 6 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum