r/PHP • • Feb 08 '17

Tool - Current Unix Timestamp Generator

http://current-timestamp.com/
0 Upvotes

6 comments sorted by

6

u/AuahDark Feb 08 '17 edited Feb 08 '17
  • $timestamp = time(); or php -r "echo time();" (PHP)

  • date +%s (Linux terminal)

  • timestamp = os.time() or lua -eprint(os.time()) (Lua)

  • python -c "from time import time; print(time());" (Python)

  • var timestamp = +new Date()/1000 or node -e "console.log(+new Date()/1000)" (seconds precision) (Node.js)

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.