www.webdeveloper.com
Results 1 to 4 of 4

Thread: Timestamp off by 10 minutes

  1. #1
    Join Date
    May 2009
    Posts
    233

    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
    Location
    Akron, OH
    Posts
    1,121
    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
    Location
    Wisconsin
    Posts
    468
    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
    Location
    localhost
    Posts
    2,326
    Where is your server host?
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

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



Recent Articles