RT wrote:
If anyone can help that would be great.
Iım trying to format a timestamp from my MySQL table (sessions)
Hereıs the code Iım using:
<?php echo date('D,n-j-y h:i:s a',strtotime($row_rsSessions['date'])); ?>
If I give the timestamp a value of 8 I can get the date to work correctly
but if itıs at 10 or 12 I get the wrong date and it comes out the same for
every record * Mon,38-1-18-09:14:07 pm
Anyone have any thoughts ?
Thanks
What do you mean by 'give the timestamp a value of 8'?
If you feed the value 8 (or 10, or 12) as a timestamp for the date
function you should not get a sensible result. (Should be sometime on
Jan 1st 1970)
A timestamp starts at Jan 1st 1970 (roughly) and goes thru to 19th Jan
2038. Looks like your result doesn't come from the format string you
quoted but from 'D,y-j-n-h:i:s a' and that it is an adjustment back from
the max value for a timestamp.
Personally I would also reccommend using date formatting functions in
your SQL statement.