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

  • Home
  • SEARCH
  • 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 9007397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:40:42+00:00 2026-06-16T01:40:42+00:00

In the below code i need to get unixtimestamp for 2 Country timezone. The

  • 0

In the below code i need to get unixtimestamp for 2 Country timezone. The output of the code will give me a date with difference but the timestamp is not differ each other. It remains same. Can anyone possible to give a solution to get different timestamp for different timezones? Thanks in advance.

date_default_timezone_set('Asia/Calcutta');
echo date("Y-m-d H:i:s")."<br/>"; //2012-12-18 12:12:12
echo strtotime(date("Y-m-d H:i:s",time()))."<br/>"; //1355812934

date_default_timezone_set('Europe/London');
echo date("Y-m-d H:i:s")."<br/>"; //2012-12-18 06:12:12
echo strtotime(date("Y-m-d H:i:s",time()))."<br/>"; //1355812934
  • 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-16T01:40:43+00:00Added an answer on June 16, 2026 at 1:40 am

    You can get time zone offset in seconds using date("Z"). And then calculate as you need.

    date_default_timezone_set('Asia/Calcutta');
    echo 'Local time : '.date("r").'<br>'; // local time
    echo 'Offset : '.date("Z").'<br>'; // time zone offset from UTC in seconds 
    echo 'UTC Time : '.date('r', strtotime(date("r")) + (date("Z")*-1)); echo '<br><br>'; // this is UTC time converted from Local time
    
    date_default_timezone_set('Europe/London');
    echo 'Local time : '.date("r").'<br>'; // local time
    echo 'Offset : '.date("Z").'<br>'; // time zone offset from UTC in seconds 
    echo 'UTC time : '.date('r', strtotime(date("r")) + (date("Z")*-1)); echo '<br><br>'; // this is utc time converted from Local time
    

    Output:

    Local time : Tue, 18 Dec 2012 10:53:07 +0530
    Offset : 19800
    UTC Time : Tue, 18 Dec 2012 05:23:07 +0530
    
    Local time : Tue, 18 Dec 2012 05:23:07 +0000
    Offset : 0
    UTC time : Tue, 18 Dec 2012 05:23:07 +0000  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

below is my android code by which I need to get the timestamp value(value
In the below code i need to get a parse exception.but the program somehow
Please i need help, this code below works fine on my localhost, php5.3+ but
Am not that skilled at Excel/VBA and need some help. The code below (in
Hi need help getting repeated value from give array,below is the code which im
In the below code every time I need to get Dept object by passing
After I launch a service like in the code below, I need to get
I need to get visitors country information using classic asp 3.0, i'm using below
in the code below, I need to get the ID of the element that
I have code below, where i need to get the return value in a

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.