Re: [PHP] converting a date to a string format

2001-02-13 Thread Jared Howard
date("Ymd", mktime(0,0,0,date("d"),date("m")-14,date("Y"))); At 03:57 PM 2/13/01 -0500, Don wrote: >Does someone have a snippet of code that retrieves today's date, >subtracts 14 days and converts the result to a string in the form >"MMDD"? > >If possible, please reply to my email. > >Thanks,

Re: [PHP] converting a date to a string format

2001-02-13 Thread Philip Olson
try something like : function pastDate($days,$format='Ymd') { $secs = ( $days * 86400 ); return date( $format,time()-$secs ); } print pastDate(14); Regards, Philip Olson http://www.cornado.com/ On Tue, 13 Feb 2001, Don wrote: > Does someone have a snippet of code that retrieves to

Re: [PHP] converting a date to a string format

2001-02-13 Thread Chris Lee
$date = getdate(); $date['mday'] -= 14; $date = getdate(mktime($date['hours'], $date['minutes'], $date['seconds'], $date['mon'], $date['mday'], $date['year'])); echo $date['year']; echo $date['mon']; echo $date['mday']; -- Chris Lee Mediawaveonline.com em. [EMAIL PROTECTED] ph. 250.37

Re: [PHP] converting a date to a string format

2001-02-13 Thread Egon Schmid (@vacation)
Don wrote: > > Does someone have a snippet of code that retrieves today's date, > subtracts 14 days and converts the result to a string in the form > "MMDD"? See http://php.net/mktime and http://php.net/date -Egon -- SIX Offene Systeme GmbH ·Stuttgart - Berlin Sielminger

[PHP] converting a date to a string format

2001-02-13 Thread Don
Does someone have a snippet of code that retrieves today's date, subtracts 14 days and converts the result to a string in the form "MMDD"? If possible, please reply to my email. Thanks, Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For add