Table of Contents
Whenever a transaction happens anywhere, it is very important to keep the time and date of that transaction in record. This record not only helps in tracing down the transaction for validity but also helps in reducing the number of frauds and maintaining the transaction details in current sequence. To maintain data and time separately is a tedious job. To get rid of this problem, timestamp was introduced which is a mixture of both. In this article we will explore all about it.
What is a Timestamp
A timestamp is a sequence of encoded date and time information almost accurate to a small fraction of seconds. There are many ways to represent timestamps, some are shown below:
- Wed 01-01-1999 6:00
- 1995-10-30 T 10:45 UTC
- 1997-11-09 T 11:20 UTC
- Sat Jul 23 02:16:57 1995
- 1256953731 (Unix time)
- (1979-07-21 T 02:56 UTC) –
- 07:38, 11 December 2019 (UTC)
- 1995-102 T 10:15 UTC (year 1985, day 102 = 12 April 1995)
- 1995-W15-5 T 10:15 UTC (year 1985, week 15, day 5 = 12 April 1995)
- 20190203073000 (02/03/2019 7:30:00)
Timestamp in Blockchain
A timestamp in a blockchain is a Date-time value that is stored in a block. As mentioned earlier, any transaction is incomplete without date and time information. In blockchain, it also tells at which time that block was created. In Blockchain this value is in the form of a Unix Timestamp.
Unix Timestamp is the number of seconds that have elapsed since 01.01.1970 which means 0000000000 in UNIX time is equal to January 1, 1970 12:00:00 AM.
A timestamp is converted value of GMT. If a block is created, it will take current time of GMT and convert it into Unix Time. Once converted, it will validate it if it is greater than the saved time of previous block. Once validated, then only it is saved. We can convert any time to UNIX time here.
In above figure, you can convert any time to Unix Time-stamp.
How to get Timestamp
- It keeps the transaction in timely order
- It helps to create a log
- It helps to reduce the cases of frauds