|
Posted by Kevin H. Feeley on 10/08/84 11:36
John K wrote:
> I recently took a job doing PHP but come from an ASP background. I'm
> trying to find a conversion equivalent for VBScript's "formatdatetime".
>
> All I want to do is convert a MySQL datetime field into a long date.
> e.g. 2006-01-30 to January 1, 2006.
>
>
> PLEASE provide an example that I can use as a future benchmark so I can
>
> understand the syntax better. I really need to learn PHP and I'm a
> little freaked out right now.
>
>
> Thanks!
2006-01-30 can be converted to "January 1, 2006" using
date("F j, Y",mktime(0,0,0,01,30,2006));
Or, you can accomplish the same task with variables stuck into the mktime
function:
date("F j, Y",mktime($hour,$minute,$second,$month,$day,$year));
Kevin
Navigation:
[Reply to this message]
|