Results 1 to 4 of 4

Thread: Timestamp off by 10 minutes

  1. #1
    Join Date
    May 2009

    Timestamp off by 10 minutes

    I have been using the same code for quite some time and just recently it is off by 10 minutes. I am using the following code to put into a mysql table (varchar).

    PHP Code:
    <input type="hidden" name="timestamp" value="<?php echo date('g:i a'); ?>" />
    Can anyone help me to get the time back on track. I have even tried to set the time zone.

  2. #2
    Join Date
    Sep 2008
    Akron, OH
    This would pull from whatever time the server is set to. You may want to contact your host.
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  3. #3
    Join Date
    Jul 2007
    Can you expand on what "off by 10 minutes" means?

    You're capturing a generic time in "hh:mm am" format. What are you comparing it to, that says you are off by 10 minutes? When are you comparing it when you find that it's 10 minutes off?

    As cbVision mentioned, because you don't specify a timestamp, it's using the server's clock. Is "Your" clock 10 minutes off of the "server's" clock?

    Quote Originally Posted by php.net
    The optional timestamp parameter is an integer Unix timestamp that defaults to the current local time if a timestamp is not given. In other words, it defaults to the value of time().

  4. #4
    Join Date
    Mar 2007
    Where is your server host?
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center