You are here: Re: How do I do date math on 'mm/dd/yyyy'? Example: 10 years earlier than today. « PHP Programming Language « IT news, forums, messages
Re: How do I do date math on 'mm/dd/yyyy'? Example: 10 years earlier than today.

Posted by john.d.mann@sbcglobal.net on 01/13/06 19:59

lwoods wrote:
> I want to calculate and display the 'mm/dd/yyyy' that is 10 years earlier
> than today.
>
> How do I do that?
>
> TIA,
>
> Larry Woods

explode() it, perform the calculation, and then implode() it. That's
what I would do, anyhow.

// configuration
$date = '01/01/2006';
$offset = '-10';
$date_glue = '/';

// implementation
$temp = explode($date_glue, $date);
$temp[2] = $temp[2] + $offset;
$date = implode ($date_glue, $date);
echo $date;

 

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

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