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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:59:07+00:00 2026-06-07T05:59:07+00:00

The displaying of a javascript-parsed date is different based on the timezone of the

  • 0

The displaying of a javascript-parsed date is different based on the timezone of the machine loading the page.

SERVER TIME: EST
MACHINE #1 TIME: EST - shows proper date
MACHINE #2 TIME: EST - shows proper date
MACHINE #3 TIME: PST - shows one day earlier 
MACHINE #4 TIME: PST - shows one day earlier 

I’m wondering how to parse a JSON date such that the time zone will not be a factor. Here’s my current code:

var jsonDate = "/Date(1341633600000)/";
var formattedDate = new Date(parseInt(jsonDate.substr(6)));
return formattedDate.getMonth() + 1 + "/" + formattedDate.getDate() + "/" + formattedDate.getFullYear();

What’s the best approach to ignore the timezone offset?

  • 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-07T05:59:08+00:00Added an answer on June 7, 2026 at 5:59 am

    The problem has nothing to do with parsing the dates. You’re sending a UTC timestamp to the client, and the client is (correctly) reflecting the date in local terms.

    You can always use the getUTCxxx methods (getUTCDate(), getUTCMonth(), getUTCFullYear()) to make the page show the date as UTC. Alternatively, you could convert the timestamp to a date string on the server in its local time zone, so that the client time zone wouldn’t figure into it at all.

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

Sidebar

Related Questions

I have a UIWebView displaying a page that contains a Javascript counter. This page
I am currently displaying date/time on my webpage using the date function PHP provides.
How can I highlight the minutes (22) when displaying this time using Javascript/jQuery? I
Is it possible to hide certain functions/fields from displaying in javascript intellisense drop down
When displaying a confirm box in javascript, there seems to be a delay after
Javascript can manipulate the document the browser is displaying, so the following: <script> document.write(<table><tr><td>Hola</td><td>Adios</td></tr></table>);
I have a Javascript Highchart that I'm displaying and trying to get more information
Can anyone suggest a good javascript library for displaying and navigating huge images in
Instead fo displaying in alert box I want to direct my output from javascript
I'm working in a Repeater over blog posts and I'm displaying a ShareThis JavaScript

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.