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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:16:08+00:00 2026-05-28T06:16:08+00:00

I have a ISO8601 date that contains a timezone offset (see below). When I

  • 0

I have a ISO8601 date that contains a timezone offset (see below). When I create a Date object from this, the date object is converted into my timezone (currently GMT), and timezone offset goes to 0. Is there any way to get the Date() constructor to preserve the timezone offset?

  var date = new Date("2012-01-17T12:55:00.000+01:00");
  console.log(date.toString());

The output I get is:

"Tue Jan 17 2012 11:55:00 GMT+0000 (GMT)"

The output I want is:

"Tue Jan 17 2012 12:55:00"
  • 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-28T06:16:09+00:00Added an answer on May 28, 2026 at 6:16 am

    Not with the built-in Date object, as they’re only aware of Local (as defined by the user’s browser and/or OS settings) and UTC. You can see this from the many cloned methods the class has (e.g., getHours / getUTCHours).

    getTimezoneOffset is the only timezone info you really have, but it’s local as well and will probably only give you +0 again (or +6 in my case):

    var date = new Date("2012-01-17T12:55:00.000+01:00");
    console.log(date.getTimezoneOffset() / 60.0);
    

    You can try timezone-js (or one of its forks), but you’ll need to know the Olson timezone name not just the GMT/UTC offset:

    var date = new new timezoneJS.Date('2012-01-17T12:55:00.000+01:00', 'Europe/Brussels');
    alert(date.getTimezoneOffset() / 60.0); // +1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string in standard ISO 8601 format that contains the date/time returned
I have been given a specification that requires the ISO 8601 date format, does
I have a ISO 8601 date, lets say: 2012-01-19T19:00-05:00 My machine timezone is GMT+1
I have an object that I printed with Data::Dumper : $VAR1 = { 'record'
Have a photography site that I want to prevent image copying from. How can
I wish to construct a date format that will optionally have a time argument.
Have some dates in my local Oracle 11g database that are in this format:
I have a date stored in a database in this format: 2011-02-23 13:00:00 I
I have this block of code to read in the ISO 8601 Date/Time specification.
I have a customer that wants to see midnight represented as the end of

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.