Simple date and timestamp converter. Support the conversion of human date and Unix epoch/timestamp. Provide developers how to get timestamp in multiple programming languages.
Language | Get timestamp |
---|---|
Java | time |
PHP | time() |
JavaScript | Math.round(new Date().getTime()/1000) |
MySQL | SELECT unix_timestamp(now()) |
PostgreSQL | SELECT extract(epoch FROM now()) |
SQLite | SELECT strftime('%s', 'now'); |
SQL Server | SELECT DATEDIFF(s, '1970-01-01 00:00:00', GETUTCDATE()) |
Python | first import time, then time.time() |
Microsoft .NET / C# | epoch = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000 |
Golang | time.Now().Unix() |
Perl | time |
Ruby | Time.now or Time.new |
Lua | epoch = os.time([date]) |
R | as.numeric(Sys.time()) |
PowerShell | [int][double]::Parse((Get-Date (get-date).touniversaltime() -UFormat %s)) |
Unix / Linux | date +%s |
VBScript / ASP | DateDiff("s", "01/01/1970 00:00:00", Now()) |
C / C++ | time(NULL) |
Objective-C | [[NSDate date] timeIntervalSince1970] |
Swift | now.timeIntervalSince1970 |
Delphi | DateTimeToUnix(Now) |
Copyright © 2018 - 2024 ToolPie. All rights reserved