Log in

View Full Version : date format issue, says 1970 always :(



wmguk
03-17-2008, 03:40 AM
Hey,

I am trying to format a date, its not a timestamp, basically you select the day, month and year from a drop down and its put in to the database in 3 seperate fields..

so if i do


$datef = "$date_day"."$date_month"."$date_year" ;

then echo $datef it displays right (17082007)

now i try and format the output, and its wrong..


$date = date("jS F Y", $datef);


i get 17th February 1970

any ideas?

Master_script_maker
03-17-2008, 07:43 PM
try:

$date = date("jS F Y");
echo $date;
and see what it outputs.

JazzcatCB
03-18-2008, 12:09 AM
Hi, try this:



echo date( 'jS F Y', mktime( 0, 0, 0, $date_month, $date_day, $date_year );

Twey
03-18-2008, 07:07 AM
Why are you storing it in this inefficient format instead of your database's native date type?