Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making sense of 'event_timestamp' numbers

I want to find the exact time stamp for an event but the numbers in the 'event_timestamp' column doesn't seem to make sense:

event_timestamp

I've been googling for some days now and I can't seem to find an answer to my problem. It's making me think if I'm asking the wrong question or if I don't actually understand what a timestamp is in this context.

I just want to be able to convert that bunch of numbers into time in seconds, minutes, and hours so I know exactly when an event got triggered by the user.

(I want the time because I want to check what other things triggered X minutes before that event got triggered)

Thanks in advance,

like image 727
Cliff Kamarga Avatar asked Oct 28 '25 08:10

Cliff Kamarga


1 Answers

As @elliott-brossard pointed, using TIMESTAMP_MICROS will convert the UNIX Epoch time into human readable time.

Let me try to explain what does that number means. UNIX Epoch time it is the number of seconds that have elapsed since 00:00:00 Thursday, 1 January 1970. Unix time is a single signed integer which increments every second, without requiring the calculations to determine year, month, day of month, hour and minute required for intelligibility to humans.

So, because the number of digits that the number that you shared has, it is in microseconds, so the calculation should be: 1/1,000,000 second. As described above, the number of seconds elapsed since 1 January 1970 is 1547938463. There are multiples ways to transform that number into human readable format, such as the way that @elliott-brossard described, also, every program language has libraries to convert that number and there are multiple web pages to do it.

like image 189
Alex Riquelme Avatar answered Oct 31 '25 10:10

Alex Riquelme



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!