Hi all:
What am I doing wrong? echo strtotime("+1 day"); comes up 1305218905 instead of with tomorrow's date.
Thanks!
Seems right to me; 1305218905 equates to 2011-05-12 11:48:25.
I am having trouble getting it into date_format
$newdate = date("r", 1305218905); $newdate2 = date_format($newdate,"Y-m-d"); echo ($newdate2);
[man]date_format[/man] expects a [man]DateTime[/man] object.
Why are you even trying to use that function anyway? Why wouldn't you just format the date properly when youcall the [man]date/man function?
bradgrafelman;10979947 wrote:[man]date_format[/man] expects a [man]DateTime[/man] object. Why are you even trying to use that function anyway? Why wouldn't you just format the date properly when youcall the [man]date/man function?
Maybe I am not looking at this the right way. What is the proper way to do this?
If you want the date in "Y-m-d" format, why are you first converting it to date()'s "r" format and then attempting to use something else to convert it into "Y-m-d" ? Why aren't you just using date() to convert the integer to "Y-m-d" and leave it at that?