0

Okay I kind of know how to display the time with PHP and MySQL but I need a little help.

I want to display the time something like this in the example below.

August 5, 2010 @ 8:47:28 PM

Here is the code I have so far that is listed below.

date('F j, Y', strtotime($date_created))

1 Answer 1

1

Did you use the chart at http://www.php.net/manual/en/function.date.php to see which characters you need for hour/minute/seconds and AM/PM? For the @ you just hardcode it in.

date('F j, Y @ g:i:s A', $whatever);
Sign up to request clarification or add additional context in comments.

3 Comments

Were you the one that came up with date('F j, Y') or did you just paste it from somewhere? All you need to do is look at that chart and modify the string to have the right characters which represent their respective time/date information much like I have it.
I came up with the code but its a little late and I'm kind had one too many beers? I'm suprised I can type. thanks for the quick answer thogh.
mii, dude. That's awesome. Do your hands get numb when you drink or something or are you just trying to hard to get your Blood Alcohol Content to .1337 and ending up in the Windows ME range. (That's an xkcd reference, by the way.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.