Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7765717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:14:02+00:00 2026-06-01T15:14:02+00:00

Consider this. On my server, I convert a (UTC/GMT) timestring like this: strtotime(‘Fri Feb

  • 0

Consider this. On my server, I convert a (UTC/GMT) timestring like this:

strtotime('Fri Feb 18 21:08:38 +0000 2011')

My server returns

1298063318

This is correct, since all unix timestamp converters that I tested, return the same. And vice versa, if I insert not the date but the timestamp, I get returned the timestring as given above. But if I convert the timestamp on my server:

date("Y-m-d H:i:s", 1298063318); 

I get back a different date than expected (being ‘Fri Feb 18 21:08:38 +0000 2011’):

2011-02-18 22:08:38

So it’s off an hour. This is probably because my servers timezone is set at Europe/Paris, and it thus translates the timestamp into UTC/GTM + 1. But MySQL, ran on the same server and having the same timezone, gives me back another result:

SELECT FROM_UNIXTIME(1298063318) = 2011-02-18 22:08:15

In other words, it is off 18 seconds. Can somebody explain why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:14:03+00:00Added an answer on June 1, 2026 at 3:14 pm

    For MySQL, a leap second correction is used for the date functions (MySQL Documentation). For PHP date functions, leap seconds are not taken into account. For that reason, you get now a 24 seconds difference.

    You can try the following to solve your problem: http://pumka.net/2010/10/24/why-mysql-timestamp-is-24-seconds-different-from-php/

    PS. 38 – 15 = 23

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this table on SQL Server wordID aliasID value =========================== 0 0 'cat' 1
Consider this code in a php file on my VPS server: <?php $url =
I'm playing with Remote Actors but I'm facing some difficulties. Consider this server: object
Consider this typical disconnected scenario: load a Customer object from SQL Server using LINQ
Consider this situation: -- Server: max_allowed_packet = 200MB -- Client: max_allowed_packet = 4MB --
Consider this example table (assuming SQL Server 2005): create table product_bill_of_materials ( parent_product_id int
I'm using SQL Server 2008 R2. Consider this table @t (TOP 20 of ORDER
Consider this Asp.net page code: <head runat=server> <title></title> <script type=text/javascript> function showhide(master, detail) {
Consider this scenario that two WCF clients connect to one WCF service(server), this service
consider this piece of code: Welcome to Scala version 2.8.0.r0-b20100714201327 (Java HotSpot(TM) 64-Bit Server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.