Jump to content

mktime(0, 0, 0, date('m'), date('d'), date('y'));


sepoto

Recommended Posts

I have some code from a developer who I do not know very well. What the code is doing is getting the current date. The problem is that now I need to backdate $today so that $today is for December, 09 2010. I am really not sure at all how I would accomplish something like that and maintain the same format that the program needs to function. I always get great help out here! Thanks.

$today = mktime(0, 0, 0, date('m'), date('d'), date('y'));//For some reason it is giving the day as tomorrow so we need to subtract a day;$today = $today;$date_begin = $today - (36 * $tz_offset);$date_end = $date_begin + 86400;

Link to comment
Share on other sites

$today = mktime(0, 0, 0, date('m'), date('d'), date('y'));
It will return the timestamp of when the day starts. I am not sure how it will return the next day.
now I need to backdate $today so that $today is for December, 09 2010.
i am not sure. are you trying to make the time stamp for December, 09 2010?
Link to comment
Share on other sites

It will return the timestamp of when the day starts. I am not sure how it will return the next day.i am not sure. are you trying to make the time stamp for December, 09 2010?
Yes. That is exactly what I am trying to do. I need to backdate the program so that it thinks today is December, 09 2010.
Link to comment
Share on other sites

date('m'),date('y'),date('d') will respectively evaluate today's month,year,day. so if you need to any other dat time or year you need to pass that value into that parameters.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...