You are here: Re: Decode and Encode Date from variables « PHP Programming Language « IT news, forums, messages
Re: Decode and Encode Date from variables

Posted by R. Rajesh Jeba Anbiah on 10/13/05 17:40

Marius III wrote:
> I want to encode a date in PHP5.
>
> I have 3 variables for ex:
>
> $day = 20 (integer)
> $month = 10 (integer)
> $year = 2005 (integer)
>
> These 3 variables must be converted to a valid date for ex:
>
> $paymentdate = EncodeDate($year, $month, $day);

Simply, sprintf() <http://in.php.net/sprintf> can be used like
sprintf("%04d-%02d-%02d", $year, $month, $day). For, more date
operations, you may use <http://www.phpinsider.com/php/code/Date_Calc/>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

 

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

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