Unix Timestamp Converter Tool
Current Timestamp
Beijing Time

Unix Timestamp → Beijing Time

Unix Timestamp
Beijing Time

Beijing Time → Unix Timestamp

Beijing Time
Unix Timestamp

Unix Timestamp Converter Overview

This tool converts Unix timestamps to standard Beijing Time and vice versa.

PHP Example of Unixtime: Get current timestamp: $time = time(); Convert to Beijing Time: $datetime = date('Y-m-d H:i:s',$time); Convert to timestamp: $unixtime = strtotime($datetime); (boxtoolbox.com)

1. Getting current Unix timestamp in different languages:

PHPtime()
Javatime
JavaScriptMath.round(new Date().getTime()/1000)
.NET / C#(DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000
MySQLSELECT unix_timestamp(now())
Perltime
PostgreSQLSELECT extract(time FROM now())
Pythonimport time; time.time()
RubyTime.now
SQL ServerSELECT DATEDIFF(s, '1970-01-01 00:00:00', GETUTCDATE())
Unix / Linuxdate +%s

2. Converting normal time to Unix timestamp in different languages:

PHPmktime(hour, minute, second, day, month, year)
Javanew java.text.SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse("01/01/1970 01:00:00")
JavaScriptnew Date(Date.UTC(year, month - 1, day, hour, minute, second))
MySQLSELECT unix_timestamp(time)
Perluse Time::Local; timelocal($sec, $min, $hour, $day, $month, $year)
PostgreSQLSELECT extract(datetime FROM date('YYYY-MM-DD HH:MM:SS'));
Pythonimport time; int(time.mktime(time.strptime('YYYY-MM-DD HH:MM:SS', '%Y-%m-%d %H:%M:%S')))
RubyTime.local(year, month, day, hour, minute, second)

3. Converting Unix timestamp to normal time in different languages:

PHPdate('r', Unix timestamp)
Javanew java.text.SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new java.util.Date(Unix timestamp * 1000))
JavaScriptnew Date(Unix timestamp * 1000).toLocaleString()
Linuxdate -d @Unix timestamp
MySQLfrom_unixtime(Unix timestamp)
Perllocaltime(Unix timestamp)
PostgreSQLSELECT TIMESTAMP WITH TIME ZONE 'time' + Unix timestamp) * INTERVAL '1 second';
Pythonimport time; time.gmtime(Unix timestamp)
RubyTime.at(Unix timestamp)
Your Footprints: