JNTZN

Epoch Time Converter

What is an epoch time converter?

An epoch time converter is a tool that converts epoch time (also known as Unix time) into human-readable date and time formats, and vice versa. Epoch time represents the number of seconds (or milliseconds) elapsed since January 1, 1970 (UTC).

What day of the year is it?

You can use our epoch time converter to view the current day of the year.

Why is epoch time used?

Epoch time is widely used because it provides a standard way to represent time across different systems, simplifies time calculations like differences or comparisons, and avoids issues related to time zones and date formats.

Is the epoch time converter free?

Yes, our epoch time converter is free to use.

Can the epoch time converter handle leap seconds?

Epoch time does not account for leap seconds. While human-readable time may include leap seconds, Unix time treats them as continuous seconds.

How do I convert epoch time manually?

To manually convert epoch time to a date, divide the epoch time by seconds in a day (86,400) to calculate the day and use a reference calendar. However, using a tool or library is far more efficient and error-free.

Get the Current Epoch Time

Language/ToolCode SnippetNotes
PHPtime()
Pythonimport time; time.time()
RubyTime.now or Time.new. To display the epoch: Time.now.to_i
Perltime
Javalong epoch = System.currentTimeMillis()/1000;Returns epoch in seconds.
C#DateTimeOffset.Now.ToUnixTimeSeconds().NET Framework 4.6+/Core.
Objective-C[[NSDate date] timeIntervalSince1970];Returns a double.
C++11double now = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch()).count();
Luaepoch = os.time([date])
VBScript/ASPSee the examples
AutoIT_DateDiff('s', "1970/01/01 00:00:00", _NowCalc())
DelphiEpoch := DateTimetoUnix(Now);Tested in Delphi 2010.
DartDateTime.now().microsecondsSinceEpoch
Ras.numeric(Sys.time())
Erlang/OTPerlang:system_time(seconds).Version 18+.
MySQLSELECT unix_timestamp(now());
PostgreSQLSELECT extract(epoch FROM now());
SQLiteSELECT strftime('%s', 'now');
Oracle PL/SQLSELECT (CAST(SYS_EXTRACT_UTC(SYSTIMESTAMP) AS DATE) - TO_DATE('01/01/1970','DD/MM/YYYY')) * 24 * 60 * 60 FROM DUAL;
SQL ServerSELECT DATEDIFF(s, '1970-01-01 00:00:00', GETUTCDATE());
IBM InformixSELECT dbinfo('utc_current') FROM sysmaster:sysdual;
JavaScriptMath.floor(new Date().getTime()/1000.0);Returns epoch in seconds.
Visual FoxProDATETIME() - {^1970/01/01 00:00:00}Time zones not handled correctly.
Gotime.Now().Unix();
Adobe ColdFusion<cfset epochTime = left(getTickcount(), 10)>;
Tcl/Tkclock seconds
Unix/Linux Shelldate +%s
Solaris/usr/bin/nawk 'BEGIN {print srand()}'Solaris doesn’t support date +%s.
PowerShell[int][double]::Parse((Get-Date (get-date).touniversaltime() -UFormat %s))