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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:10:57+00:00 2026-05-21T02:10:57+00:00

Could you please advice how to remove an hour from unixtime. I have a

  • 0

Could you please advice how to remove an hour from unixtime.

I have a unixtime and i need to remove an extra hour before converting to normal time. Could you please advice how to do this?

Also, is Unixtime affected by the GMT time changes?

  • 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-21T02:10:58+00:00Added an answer on May 21, 2026 at 2:10 am

    Unix timestamps are measured in seconds, there are 3600 seconds in an hour (60 minutes, each with 60 seconds = 60*60 = 3600), so just subtract:

    $timestamp = time();
    $timestamp_less_one_hour = $timestamp - 3600;
    

    You can also use strtotime to accomplish the same:

    $timestamp_less_one_hour = strtotime('-1 hour', $timestamp);
    

    Or if $timestamp is simply “now” you can call strtotime without the second parameter:

    $timestamp_less_one_hour = strtotime('-1 hour'); // time() - 1 hour
    

    So you seem to be looking for GMT time instead, the trouble is GMT can include Daylight Savings Time (DST), and the “GMT” date functions in PHP actually return UTC time, which has no concept of DST. Luckily you can detect if it’s DST using PHP, and basically adjust appropriately.

    Get UTC time using gmdate:

    $utc_time = gmdate('U'); // return Unix seconds in UTC timezone
    

    Detect if it’s DST using I:

    $is_dst = gmdate('I'); // 1 when it's DST, 0 otherwise
    

    gmdate('U') will trail GMT time during DST by an hour, thus you need to give it +3600 seconds, or 1 hour when it’s DST, so putting this together:

    $gmt_time = gmdate('U') + (3600*gmdate('I'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone please advice why i have a memory leak in this code? I
could you please advice how to connect to development machine from device? I can
Could you please advice me a plugin or a solution on jquery. I need
Could someone please tell me why this <%= destroy_password_url @user.password_reset_token %> generates http://localhost:3000/api/destroy_password.4G5EoRVYMUAtiIKqOerKsw routes.rb
Could someone please suggest why this is happening... I’ve got some code to pretty
could somebody please take a look at this http://jsfiddle.net/bloodygeese/EzkFR/1/ My aim is to on
Could someone please explain why this is happening? var y = new int[]{1,2}; Console.WriteLine(y
so basically I have this scope(sql): scope.to_sql => SELECT \offers\.* FROM \offers\ INNER JOIN
could you please advice how to track progress of file upload to HTTP Server?
Could you please advice a Server against which I can test my Class which

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.