sepoto Posted May 13, 2011 Share Posted May 13, 2011 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 More sharing options...
birbal Posted May 13, 2011 Share Posted May 13, 2011 $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 More sharing options...
sepoto Posted May 13, 2011 Author Share Posted May 13, 2011 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 More sharing options...
birbal Posted May 13, 2011 Share Posted May 13, 2011 It will be something like.. mktime(0,0,0,12,9,2010); Youmay want to check it http://php.net/function.mktime Link to comment Share on other sites More sharing options...
birbal Posted May 13, 2011 Share Posted May 13, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.