Jump to content

strtotime("+n hours") displaying same time for AM and PM


ajetrumpet

Recommended Posts

I apologizing for bothering the expert here again, but I've run into another issue.  I am using the following code because I can't change the default timezone on my shared hosting plan:

$time = date("h:i A", strtotime("+19 hours"));

there are few issues with this.  if I just use: date("h:i: A") the time prints as 7 hours earlier than my timezone, and currently it shows 1:09 AM and it appears in the database as "01:09:00".  if I use the code above, the time prints out as "08:09 PM", but it is inserted into the database as "08:09:00".  Shouldn't it read "20:09:00" instead?  and why isn't the time being inserted into the database with the "PM" suffix on it like it appears in the printout?  the "time" field in my database is set to type TIME.

thanks.

Edited by ajetrumpet
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.