Hello all
I have timestamp field in a table
when I print this value (called $time) as:
echo $time;
I have:
2007-03-13 17:05:07.768449+13
Now I want to display this as:
13-03-07 17:05:07
I tried:
echo date('d-m-y H:i:s', strtotime($time));
It shows
01-01-70 11:59:59
What is wrong here
Please help
Many thanks
Regards
sh
format date
Moderator: General Moderators
In your query that retrieves the data, format the date at that point rather than doing it in PHP.
Look up the date_format function on this page Date Functions
Look up the date_format function on this page Date Functions
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I believe johnhelen is using Postgre
http://www.postgresql.org/docs/8.2/inte ... etime.html should be of interest.
http://www.postgresql.org/docs/8.2/inte ... etime.html should be of interest.