Re: converting a date to a string format

From: Date: Tue, 13 Feb 2001 21:14:41 +0000
Subject: Re: converting a date to a string format
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39497@lists.php.net to get a copy of this message
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 today's date, > subtracts 14 days and converts the result to a string in the form > "YYYYMMDD"? > > If possible, please reply to my email. > > Thanks, > Don > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#39497) next »