What Is The Unix EPOCH?

The Unix EPOCH is the (or Unix time or POSIX time or Unix timestamp), is the number of seconds that have elapsed since January 1.

You can calculate it in MySQL with;

SELECT unix_timestamp(now())

On PL/SQL with;

SELECT (SYSDATE – TO_DATE(’01/01/1970 00:00:00′, ‘MM-DD-YYYY HH24:MI:SS’)) *
24 * 60 * 60 FROM DUAL

On SQL Server;

SELECT DATEDIFF(s, ‘1970-01-01 00:00:00’, GETUTCDATE())SELECT DATEDIFF(s, ‘1970-01-01 00:00:00’, GETUTCDATE())

On  Postgre;

SELECT extract(epoch FROM now());

HTH – Antonio NAVARRO

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s