PHP working time logic

what exactly happens when you create a Unix timestamp from a specific date.

I want the step-by-step method to create a timestamp. (not using php built-in functions).

EDIT: What is the specialty of this date :) January 1, 1970 00:00 h UTC

+4
source share
2 answers

January 1, 1970 00:00 h UTC is the Epoch date:

Then the β€œera” serves as a reference point, from which time is measured. Time units from an era are calculated, so that the date and time of events can be specified unambiguously.

In computing, this date is an era for UNIX: UNIX timestamps (as used by PHP) are actually the number of seconds since this era.

This means that to create a timestamp, you need to calculate how many seconds have passed since January 1, 1970.

+5
source

You just need to count the seconds that have passed since January 1, 1970 00:00 h UTC so far (not counting the seconds of the jump)!

+2
source

All Articles