Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the length of current Unix timestamp greater then 10 Digits

My Question Is :

Is The time() [10 Digits Number (Seconds)] can Be Increased to 11 or 12 digits ?

The Purpose of Asking This Question is I am creating A uniq transaction id depending on that and with some other variable.. I have to maintain a Length of 18 Digits (Numbers only)

Edit : Note I dont want to make it longer.. As it increases to 11/12 digits i have to make the rest 7/8 digits dynamically .. Because i am using 2 randomiser for that last 7/8 digits

Edit2: Will it make sense => rand(8 Digits) vs rand(3) + rand(3) + rand(2) For Collision Purpose ??

like image 542
void Avatar asked May 07 '20 12:05

void


People also ask

How many digits is a Unix timestamp?

Unix epoch timestamps are supported in the following formats: 10 digit epoch time format surrounded by brackets (or followed by a comma).

Is epoch time always 10 digits?

No. epoch time is how time is kept track of internally in UNIX. It's seconds, counting upward from January 1st, 1970.

What is the max Unix timestamp?

"2,147,483,647 – The End of Time [Unix]".

How do you calculate Unix timestamp?

Here’s an example of how Unix timestamp is calculated from the wikipedia article: The Unix time number is zero at the Unix epoch, and increases by exactly 86 400 per day since the epoch. Thus 2004-09-16T00:00:00Z, 12 677 days after the epoch, is represented by the Unix time number 12 677 × 86 400 = 1 095 292 800.

How many digits are in a timestamp?

Today’s timestamp requires 10 digits. What is Unix time format? How does Unix calculate time? What is a 13 digit timestamp? What is current Unix timestamp? What timestamp format is this? What is the epoch date today? How do I convert UNIX time to normal time? How do you calculate time duration? What is timestamp example?

How many digits is Unix time?

How many digits is Unix time? - CompuHoy.com How many digits is Unix time? Today’s timestamp requires 10 digits. What is Unix time format?

Why is the Unix time stamp not working?

On this date the Unix Time Stamp will cease to work due to a 32-bit overflow. Before this moment millions of applications will need to either adopt a new convention for time stamps or be migrated to 64-bit systems which will buy the time stamp a "bit" more time.


1 Answers

If you run date() with a time parameter containing the first 11 digit time you will see that you will not get 11 digits in a time() until

echo date('d/m/Y H:i:s', 10000000000);

RESULT

20/11/2286 17:46:40

If you think that your App will be running after that date you should worry about this situation, otherwise you dont need to worry or code for it.

PS I doubt PHP will exist or Intel come to that in 2286 :)

like image 169
RiggsFolly Avatar answered Sep 23 '22 02:09

RiggsFolly