jessyhoule

Calculate Current Milliseconds

May 12th, 2017
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. var milliseconds = (DateTime.UtcNow - new DateTime (1970, 1, 1)).TotalMilliseconds;
  2.  
  3. // ActionScript
  4. (new Date()).time;
  5.  
  6. // C++
  7. #include "time.h" time_t seconds; time(&seconds);
  8. unsigned long long millis = (unsigned long long)seconds * 1000;
  9.  
  10. // Excel / Google Sheets*
  11. =(NOW() - CELL_WITH_TIMEZONE_OFFSET_IN_HOURS/24 - DATE(1970,1,1)) * 86400000
  12.  
  13. // Go / Golang
  14. time.Now().UnixNano() / 1000000
  15.  
  16. // Java
  17. System.currentTimeMillis();
  18. Javascript  new Date().getTime();
Advertisement
Add Comment
Please, Sign In to add comment