Jump to content

Date/time


kelleydl

Recommended Posts

in my form, when a user clicks submit the information goes to a table. in my table i want to store the date and time of when that user clicks submit. at the moment i am using the timestamp but it is 24 hour time and not 12 and i want it to be eastern timezone. ive tried using date() and mktime() and i just dont think im understanding how it all works. it keeps returning 0's for everything. or maybe im not sending it to my table the correct way. im trying different things and they dont seem to be working..

Link to comment
Share on other sites

Guest FirefoxRocks
in my form, when a user clicks submit the information goes to a table. in my table i want to store the date and time of when that user clicks submit. at the moment i am using the timestamp but it is 24 hour time and not 12 and i want it to be eastern timezone. ive tried using date() and mktime() and i just dont think im understanding how it all works. it keeps returning 0's for everything. or maybe im not sending it to my table the correct way. im trying different things and they dont seem to be working..
For "table" I assume you mean a table in a database. Is your column set at `datetime`?You should use 24 hour clock. A datetime must be stored as YYYY-MM-DD HH:MM:SS. So by using date("Y-m-d H:i:s") and date_default_timezone_set("America/Thunder_Bay") you should get the correct time inserted in the database.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...