Author |
Message |
Wiesel
Joined: 16 Aug 2005 Posts: 1
|
Posted: Tue Aug 16, 2005 10:40 am Post subject: internal date format in python |
|
|
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 |
|
|
Studio 12 Site Admin
Joined: 04 Aug 2004 Posts: 67
|
Posted: Tue Aug 16, 2005 11:31 am Post subject: |
|
|
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 |
|
|
Lisa
Joined: 04 Aug 2004 Posts: 118 Location: Amsterdam
|
|
Back to top |
|
|
Studio 12 Site Admin
Joined: 04 Aug 2004 Posts: 67
|
Posted: Wed Aug 17, 2005 1:22 pm Post subject: |
|
|
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 |
|
|
|