Page 1 of 1

smurf around with dates..

Posted: Fri Nov 29, 2002 6:21 pm
by Jim
Two questions...

First, how do I get the date to display the full name of the day of the week, such as "Friday" rather than "Fri".

Also, I'm using the following function to change timestamps from a MYSQL DB into something understandable by most folk:

Code: Select all

function formatDate($val)
{
	$arr = explode("-", $val);
	return date("D F Y", mktime(0,0,0, $arrї1], $arrї2], $arrї0]));
}
When I use it, the year seems to come up as 1969. How do I fix that?

Thanks for help!

Posted: Fri Nov 29, 2002 8:21 pm
by volka
http://www.php.net/manual/en/function.date.php
he following characters are recognized in the format string:
...
l (lowercase 'L') - day of the week, textual, long; e.g. "Friday"
strtotime
strtotime -- Parse about any English textual datetime description into a UNIX timestamp
hope this is helpful ;)

Posted: Sat Nov 30, 2002 2:39 am
by BigE
There are also MySQL functions for timestamps in the database such as UNIX_TIMESTAMP(). I suggest you read the MySQL manual on how to do this. Hope that helps.