|
deathGod - 07 Sep 2008
no. everyone posted on different days. Paul has just used todays date as the date people have posted instead of storing the actual posting date in a database and calling it each time, which is what he would have to do if he wanted to have the actual date of posting displayed.
This was posted on the 18th June 2006
What's the date today? - 07 Sep 2008
Did everyone really post their comments on the same day?
Vu - 07 Sep 2008
< Definition:
< int mktime ( [int hour [, int minute [, int second [, int
< month [, int day [, int year [, int is_dst]]]]]]])
<
< Sample:
< So, to pass in 10:30pm on the 20th of June 2005, you
< would use mktime() like this:
<
< $unixtime = mktime(22, 30, 0, 20, 6, 2005, -1);
"20" and "6" should change the places according to above definition.
Else, the the resulted Unix timestamp would be 1154921400, which is equivalent to 2006-08-06 22:30:00, meaning PHP subtracts 12 from 20 to get August and increases the year by 1 to 2006.
Vu - 07 Sep 2008
< Definition:
< int mktime ( [int hour [, int minute [, int second [, int
< month [, int day [, int year [, int is_dst]]]]]]])
<
< Sample:
< So, to pass in 10:30pm on the 20th of June 2005, you
< would use mktime() like this:
<
< $unixtime = mktime(22, 30, 0, 20, 6, 2005, -1);
"20" and "6" should change the places according to above definition.
Else, the the resulted Unix timestamp would be 1154921400, which is equivalent to 2006-08-06 22:30:00, meaning PHP subtracts 12 from 20 to get August and increases the year by 1 to 2006.
A PHP User - 07 Sep 2008
hmm, yeah daylight savings time can be determined from the date, and it's relatively easy to do that (if the OS supports it) but on the long day of the year (start of daylight saving) there's two hours that only differ by the setting of the daylight saving indicator.
A PHP User - 07 Sep 2008
< Definition:
< int mktime ( [int hour [, int minute [, int second [, int
< month [, int day [, int year [, int is_dst]]]]]]])
<
< Sample:
< So, to pass in 10:30pm on the 20th of June 2005, you
< would use mktime() like this:
<
< $unixtime = mktime(22, 30, 0, 20, 6, 2005, -1);
Isn't it that "20" and "6" should change the places according to above definition?
So, I'm confused now. What is the proper way to place arguments to mktime? Is it h,m,s,month,day,year,dst or h,m,s,day,month,year,dst?
Guna - 07 Sep 2008
The information about mktime() will correct crazy date values( month = 19) is very informative.
three chapters on date function is good. but it will be more useful and informative, if you have explained, how to handle dates less than 1970-01-01.
Whenever i try to get timestamp of a date less than 1970-01-01 it gives on error.
Is any way to handle such sitution?
Add comment
Please note that by posting a comment here you are committing it to the public domain. This is important so that others can make use of your code themselves, and also so that I can incorporate helpful notes directly into the main text. Comments are limited to 2000 characters in length.
If you are reporting an error in the content, please tell me directly.
|