Time - (Unix|POSIX|Epoch) time

About

Unix time (also known as POSIX time or Epoch time) is a system for describing instants in time.

It's the number of milliseconds / second since a start date (generally Thursday, 1 January 1970) but if you start your own epoch, you may change it to get more space (on 32bit second level, you get 68 years)

It is used widely in Unix-like and many other operating systems and file formats.

Precision

Instant - Precision

Second

It's the number of seconds (or millisecond) that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, not counting leap seconds.

Because it does not handle leap seconds, it is neither a linear representation of time nor a true representation of UTC.

Instants:

  • after the epoch have positive values,
  • before the epoch have negative values.

At a second level, because a timestamp is stored 32 bit integer, the max year for a Unix Timestamp is 2038 (ie 68 years from 1970) <MATH>2 147 483 648\text{ seconds} = 68.1\text{ years}</MATH>

Day

An epoch day is a incrementing count of days where day 0 is 1970-01-01.

Command

Bash / Linux

Unix time may be checked on most Unix systems by typing date +%s on the command line.

Java

System.currentTimeMillis()

Oracle

  • Example 1:
myDate = TO_DATE('19700101000000','YYYYMMDDHH24MISS') + NUMTODSINTERVAL(myUnixTimeStamp, 'SECOND')
  • Example 2:
select TO_CHAR( FROM_TZ( CAST(DATE '1970-01-01' + (1/24/60/60/1000) * <column name> AS TIMESTAMP), 'America/New_York'), 'MM/DD/YYYY HH24:MI:SS') from <tablename>;

Documentation / Reference





Discover More
Bdm Component
BDM - Model Repository Service (MRS)

The Model Repository Service is an application service that manages the Model repository. The Model Repository Service manages metadata : mappings, workflows and applications. The Model repository...
Bdm Component
BDM - Workflow

workflow. from : FAQ: How to retrieve workflow details in Model Repository Views? EPOCH time
Date - time part

The time part of an instant are the following components : Hour, Minute, Seconds from . Example: 02:00:00 hours 3600000 milli-seconds (a negative number is milliseconds before January...
Card Puncher Data Processing
Google Analytics - Client Id (cid) - Anonymous Id

ClientId is the anonymous user id in Google analytics If a cookie does not exist for the specified domain, a client ID is generated and stored in the cookie The client id is stored in the utma...
Card Puncher Data Processing
Google Analytics - Utma Cookie

The Utma cookie is one of the Ga cookie that fulfill the role of cookie identifier The __utma cookie is used to distinguish users and sessions. The cookie is created when the javascript library...
Card Puncher Data Processing
Google Analytics - Utmb cookie

The Utmb cookie is one of the Ga cookie that fulfill the role of session cookie It's used to determine new sessions/visits. The cookie is created when the javascript library executes and it does...
How to manipulate and show a Date Time in Javascript?

In javascript, date time information is represented in a a date object that: encapsulates the epoch time in milliseconds is timezone-agnostic Date.now() returns the number of milliseconds...
JSON - ObjectId

ObjectId are generated identifier (known as surrogate) with the intent to be unique for a Json. ObjectId are custom UUID that are created from: a counter timestamp (milliseconds) node id (IP...
Java Conceptuel Diagram
Java - Date

A Date is a java object that wraps time information. java/util/Date - The class Date represents a specific instant in time, with millisecond precision. It's an instant on the time-line, not a “date”....
Data System Architecture
Ordinal Data

Ordinal data are data that can be ordered on an ordinal scale in order to rank them. Each ordinal data can therefore be translated into a number . This is a functionality/behavior of the data type...



Share this page:
Follow us:
Task Runner