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 3805128
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:37:41+00:00 2026-05-19T14:37:41+00:00

I just want to check if time() returns a UTC/GMT timestamp or do I

  • 0

I just want to check if time() returns a UTC/GMT timestamp or do I need to use date_default_timezone_set()?

  • 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-05-19T14:37:42+00:00Added an answer on May 19, 2026 at 2:37 pm

    time returns a UNIX timestamp, which is timezone independent. Since a UNIX timestamp denotes the seconds since 1970 UTC you could say it’s UTC, but it really has no timezone.


    To be really clear, a UNIX timestamp is the same value all over the world at any given time. At the time of writing it’s 1296096875 in Tokyo, London and New York. To convert this into a “human readable” time, you need to specify which timezone you want to display it in. 1296096875 in Tokyo is 2011-01-27 11:54:35, in London it’s 2011-01-27 02:54:35 and in New York it’s 2011-01-26 21:54:35.

    In effect you’re usually dealing with (a mix of) these concepts when handling times:

    • absolute points in time, which I like to refer to as points in human history
    • local time, which I like to refer to as wall clock time
    • complete timestamps in any format which express an absolute point in human history
    • incomplete local wall clock time

    Visualise time like this:

    -------+-------------------+-------+--------+----------------+------>
           |                   |       |        |                |
    Dinosaurs died        Jesus born  Y2K  Mars colonised       ???
    

    (not to scale)

    An absolute point on this line can be expressed as:

    • 1296096875
    • Jan. 27 2011 02:54:35 Europe/London

    Both formats express the same absolute point in time in different notations. The former is a simple counter which started roughly here:

                              start of UNIX epoch
                                      |
    -------+-------------------+------++--------+----------------+------>
           |                   |       |        |                |
    Dinosaurs died        Jesus born  Y2K  Mars colonised       ???
    

    The latter is a much more complicated but equally valid and expressive counter which started roughly here:

                  start of Gregorian calendar
                               |
    -------+-------------------+-------+--------+----------------+------>
           |                   |       |        |                |
    Dinosaurs died        Jesus born  Y2K  Mars colonised       ???
    

    UNIX timestamps are simple. They’re a counter which started at one specific point in time and which keeps increasing by 1 every second (for the official definition of what a second is). Imagine someone in London started a stopwatch at midnight Jan 1st 1970, which is still running. That’s more or less what a UNIX timestamp is. Everybody uses the same value of that one stopwatch.

    Human readable wall clock time is more complicated, and it’s even more complicated by the fact that it’s abbreviated and parts of it omitted in daily use. 02:54:35 means almost nothing on the timeline pictured above. Jan. 27 2011 02:54:35 is already a lot more specific, but could still mean a variety of different points on this line. “When the clock struck 02:54:35 on Jan. 27 2011 in London, Europe“ is now finally an unambiguous absolute point on this line, because there’s only one point in time at which this was true.

    So, timezones are a “modifier” of “wall clock times” which are necessary to express a unique, absolute point in time using a calendar and hour/minute/second notation. Without a timezone a timestamp in such a format is ambiguous, because the clock struck 02:54:35 on Jan. 27 2011 in every country around the globe at different times.

    A UNIX timestamp inherently does not have this problem.


    To convert from a UNIX timestamp to a human readable wall clock time, you need to specify which timezone you’d like the time displayed in. To convert from wall clock time to a UNIX timestamp, you need to know which timezone that wall clock time is supposed to be in. You either have to include the timezone every single time with each such conversion, or you set the default timezone to be used with date_default_timezone_set.

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

Sidebar

Related Questions

Basically I just want to check if one time period overlaps with another. Null
I just want to check if I understood well the way asynchronous Http request
I just want to check if there is any easy way to limit zooming.
I just want to check whether the facebook user is atleast on facebook for
I just want to check and see if a row exists where the $lectureName
Before Entering data into a database, I just want to check that the database
Possible Duplicate: check whether internet connection is available with C# I just want to
I want to check if a checkbox just got unchecked, when a user clicks
Just want to ask if i can use Custom Validator in client side without
Just want to make sure one thing. In a windows machine (either a desktop

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.