You need to pass date() a serial time value, a timestamp. This is quite clearly documented in the PHP manual under date(). If you get stuck , try date("Y-m-d",time()) and work from there.

Also, you need to use the SQL function UNIX_TIMESTAMP(day) to return a timestamp in the way you are trying to do this. You may as well calculate a days worth of seconds and add that to the value which is returned from the SQL. Many other (better) ways exist using SQL to do what you want and they are all well documented.

Cheers - Neil.

At 16:46 11/08/2003 +0000, you wrote:
Message-ID: <[EMAIL PROTECTED]>
From: "Harpreet" <[EMAIL PROTECTED]>
Subject: date question

I use the below sql statement to add one day to the date
select DATEADD(day,1,'2003-08-11 23:59:59') as datered

It returns
$expir="Aug 12 2003 11:59PM"

To convert the format to YYYY-MM-DD I use
 $expir=date('Y-m-d', $expir);

The new value returned is 1969-12-31. What am i doing wrong. The only thing
I want to do is convert my date to a YYYY-MM-DD format.

Please help.

Thanks,

Harpreet



======================================================== CaptionKit http://www.captionkit.com : Production tools for accessible subtitled internet media, transcripts and searchable video. Supports Real Player, Quicktime and Windows Media Player.

VideoChat with friends online, get Freshly Toasted every
day at http://www.fresh-toast.net : NetMeeting solutions
for a connected world.






-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to