|
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]
|