Skip to content

Instantly share code, notes, and snippets.

@Visgean
Created August 16, 2011 13:43
Show Gist options
  • Select an option

  • Save Visgean/1149101 to your computer and use it in GitHub Desktop.

Select an option

Save Visgean/1149101 to your computer and use it in GitHub Desktop.

python:

>>> import time
>>> from datetime import datetime as dt
>>> yess = dt(year = 2012, month=9, day=1, hour=8, minute=20)
>>> time.mktime(yess.timetuple())
1346480400.0

Javascript:

[15:24:23.061] yess = new Date(2012, 9, 1, 8, 20).getTime() / 1000
[15:24:23.065] 1349072400
--
[15:24:46.604] yess = new Date(2012, 9, 1, 8, 20).getTime()
[15:24:46.607] 1349072400000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment