Jump to content

formatting date on output


aquatsr

Recommended Posts

I input the date a new record is added by using the NOW() function in MySQL. The problem is that the server time is 3 hours ahead of local time, and I want to display the dates using php in my timezone. How do I do that while still using NOW()Also, if I wanted to display the date in the user's local timezone, how would I do that?

Link to comment
Share on other sites

You can take off any value you need, for example: (NOW() - 20).The number '20' depends on you database field data format (DATETIME, DATE, TIMESTAMP, TIME).
OK. Say the field is DATE and I want to take off 3 hours?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...