Timestamp - Javascript

Date/Time Timezone - TimestampConvert date time with timezone to timestamp

TimeStamp

0
Generate NowGenerate timestamp now time

Current Time - Local

Tue Jun 16 2020 12:01:00 GMT+0000 (Coordinated Universal Time)

Current Time - Local

6/16/2020, 12:01:00 PM

Current Time - ISO Format

2020-06-16T12:01:00.000Z

Current Time - UTC Format

Tue, 16 Jun 2020 12:01:00 GMT

Current TimeStamp

0
Timestamp - DateConvert timestamp to date

Date - Local

Tue Jun 16 2020 12:01:00 GMT+0000 (Coordinated Universal Time)

Date - Local

6/16/2020, 12:01:00 PM

Date - ISO Format

2020-06-16T12:01:00.000Z

Date - UTC Format

Tue, 16 Jun 2020 12:01:00 GMT

What is timestamp?

A timestamp is a sequence of characters or encoded information identifying when a certain event occurred, usually giving date and time of day, sometimes accurate to a small fraction of a second. The term derives from rubber stamps used in offices to stamp the current date, and sometimes time, in ink on paper documents, to record when the document was received. Common examples of this type of timestamp are a postmark on a letter or the "in" and "out" times on a time card. In modern times usage of the term has expanded to refer to digital date and time information attached to digital data. For example, computer files contain timestamps that tell when the file was last modified, and digital cameras add timestamps to the pictures they take, recording the date and time the picture was taken. - Timestamp - Wikipedia

Javascript Timestamp vs Unix Timestamp

The javascript timestamp obtained by the getTime() or Date.now() function is a 13-character string, representing the number of milliseconds passed since January 1, 1970 00:00:00 UTC known as Unix Epoch. The unix timestamp uses the seconds containing only 10 characters as a unit of measurement.


Monzila Developer - getTime()

Monzila Developer - Date.Now() reference



* JavaScript uses milliseconds as the unit of measurement, whereas Unix Time is in seconds. - MDN web docs


Timestamp Unix (seconds) anothers languages

JavaScript: Math.floor(new Date().getTime()/1000.0)

PHP: time()

Python: import time; time.time()

Java: long epoch = System.currentTimeMillis()/1000;

C#: DateTimeOffset.Now.ToUnixTimeSeconds()

PowerShell: [int][double]::Parse((Get-Date (get-date).touniversaltime() -UFormat %s))

Unix/Linux Shell: date +%s

Timestamp Unix (milliseconds) anothers languages

JavaScript: Date.now() // or: new Date().getTime()

PHP: round(microtime(true) * 1000)

Python: int(round(time.time() * 1000))

Java: System.currentTimeMillis()

C#: DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()

PowerShell: [double](Get-Date -Date ((Get-Date).ToUniversalTime()) -UFormat %s) * 1000