Re: Getting and formating todays date...

From: Date: Fri, 09 Jun 2000 17:46:10 +0000
Subject: Re: Getting and formating todays date...
Groups: php.general 
Request: Send a blank email to php-general+get-1406@lists.php.net to get a copy of this message
You just need to "wrap" another date() function around it... So, before your echos do: $todaysdate = date("Ymd", $todaysdate); $thirtydays = date("Ymd", $thirtydays); In article <NDBBKCGDALIIJFOOKNMBAEIMCFAA.graham@tridia.com>, Graham Paul Wooden <graham@tridia.com> wrote: >Hello all, >I know I am close, but maybe a little far .... >I need a variable to be todays date in format like 20000609. >I also need to set another variable be 30 days from now, hence 20000709. >I am doing the following: ><?php >$todaysdate = mktime (0,0,0,date("m") ,date("d") ,date("Y")); >$thirtydays = mktime (0,0,0,date("m")+1,date("d") ,date("Y")); >echo strftime ("Todays Date: $todaysdate<br>"); >echo ("Expiration : $thirtydays<br>"); >?> >But it's returning the number of seconds since UNIX epoch (i think...). >Am I missing a function to get it in to the format I need it in? >Thanks all!! >-Graham. >graham@tridia.com .

« previous php.general (#1406) next »