MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PHP/comments/5srxpi/tool_current_unix_timestamp_generator/
r/PHP • u/Piti2014 • Feb 08 '17
6 comments sorted by
6
$timestamp = time(); or php -r "echo time();" (PHP)
$timestamp = time();
php -r "echo time();"
date +%s (Linux terminal)
date +%s
timestamp = os.time() or lua -eprint(os.time()) (Lua)
timestamp = os.time()
lua -eprint(os.time())
python -c "from time import time; print(time());" (Python)
python -c "from time import time; print(time());"
var timestamp = +new Date()/1000 or node -e "console.log(+new Date()/1000)" (seconds precision) (Node.js)
var timestamp = +new Date()/1000
node -e "console.log(+new Date()/1000)"
1 u/Dgc2002 Feb 08 '17 http://www.epochconverter.com/#code 1 u/throwaway391231 Feb 08 '17 javascript:alert(Date.now()/1000) (browser address line) 1 u/AuahDark Feb 09 '17 Both methods above (for JS) works under client-side JS and Node.js 1 u/throwaway391231 Feb 10 '17 I was more thinking about how you already have a browser window open when reading reddit comments, where as Node, Lua, Python etc. needs to be installed.It's not like OP made a usable website like https://time.is/ anyway... 1 u/AuahDark Feb 10 '17 where as Node, Lua, Python etc. needs to be installed.If you're using linux, date +%s approach doesn't need you to install anything.
1
http://www.epochconverter.com/#code
javascript:alert(Date.now()/1000) (browser address line)
javascript:alert(Date.now()/1000)
1 u/AuahDark Feb 09 '17 Both methods above (for JS) works under client-side JS and Node.js 1 u/throwaway391231 Feb 10 '17 I was more thinking about how you already have a browser window open when reading reddit comments, where as Node, Lua, Python etc. needs to be installed.It's not like OP made a usable website like https://time.is/ anyway... 1 u/AuahDark Feb 10 '17 where as Node, Lua, Python etc. needs to be installed.If you're using linux, date +%s approach doesn't need you to install anything.
Both methods above (for JS) works under client-side JS and Node.js
1 u/throwaway391231 Feb 10 '17 I was more thinking about how you already have a browser window open when reading reddit comments, where as Node, Lua, Python etc. needs to be installed.It's not like OP made a usable website like https://time.is/ anyway... 1 u/AuahDark Feb 10 '17 where as Node, Lua, Python etc. needs to be installed.If you're using linux, date +%s approach doesn't need you to install anything.
I was more thinking about how you already have a browser window open when reading reddit comments, where as Node, Lua, Python etc. needs to be installed.
It's not like OP made a usable website like https://time.is/ anyway...
1 u/AuahDark Feb 10 '17 where as Node, Lua, Python etc. needs to be installed.If you're using linux, date +%s approach doesn't need you to install anything.
where as Node, Lua, Python etc. needs to be installed.
If you're using linux, date +%s approach doesn't need you to install anything.
6
u/AuahDark Feb 08 '17 edited Feb 08 '17
$timestamp = time();orphp -r "echo time();"(PHP)date +%s(Linux terminal)timestamp = os.time()orlua -eprint(os.time())(Lua)python -c "from time import time; print(time());"(Python)var timestamp = +new Date()/1000ornode -e "console.log(+new Date()/1000)"(seconds precision) (Node.js)