144
rated 0 times
[
145]
[
1]
/ answers: 1 / hits: 29126
/ 14 Years ago, wed, february 16, 2011, 12:00:00
I'm having difficulty working with dates in Python and Javascript.
>>> d = date(2004, 01, 01)
>>> d
datetime.date(2004, 1, 1)
>>> time.mktime(d.timetuple())
1072944000.0
Then, in Javascript (data sent over Ajax):
>>> new Date(1072944000.0)
Tue Jan 13 1970 02:02:24 GMT-0800 (PST) {}
I'm confused. Shouldn't the Javascript date be the same as the one that I entered in Python? What am I doing wrong?
More From » python