You are here: Re: FormatDateTime in PHP « PHP Programming Language « IT news, forums, messages
Re: FormatDateTime in PHP

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация