views:

81

answers:

2

what is exactly happing when creating a Unix Timestamp from a given date.

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

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

+2  A: 

You just have to count the seconds that elapsed from January 1st 1970 00:00 h UTC until now (not counting leap seconds)!

Alex
Easy money. ;) 
Gumbo
@Alex could you please check my EDIT
coderex
+5  A: 

January 1st 1970 00:00 h UTC is the date of the Epoch :

The "epoch" then serves as a reference point from which time is measured. Time measurement units are counted from the epoch so that the date and time of events can be specified unambiguously.

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

This means that, to create a timestamp, you have to count how many seconds have passed since the 1st January 1970.

Pascal MARTIN