Timestamp

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
thoughtriot
Forum Commoner
Posts: 26
Joined: Thu Nov 07, 2002 9:32 pm

Timestamp

Post by thoughtriot »

Ok, I have a timestamp field in a table, and I can insert values into it fine, but how would I extract the field in the format m.d.y? Because if I just extract the timestamp field normally like all the other fields, it comes out in a format I don't want. And also, how would I echo the timestamp field after I extract it. Thanks.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You can format the timestamp using MySQL's DATE_FORMAT function:
http://www.mysql.com/doc/en/Date_and_ti ... ml#IDX1282
Then you can just echo the result without doing anything to it.

Mac
Post Reply