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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:33:59+00:00 2026-05-25T18:33:59+00:00

I have a time-stamp in milliseconds ( Unix time / time from Epoch )

  • 0

I have a time-stamp in milliseconds (Unix time / time from Epoch) sent from my server, which uses Joda-time and always the constant timezone “America/New_York“. On my client, I also want to guarantee time is displayed according to the America/New_York timezone. I’ve relied on the MDN Date documentation, and have decided it’s easiest to instantiate my Date objects using the new Date(milliseconds) constructor.

Now the hard part: I want to be able to print the time for clients that are using my site outside the America/New_York timezone. I know I can getTimezoneOffset from a Date object, so now I’m considering performing arithmetic on that object based on the offset and relying on the server to tell me if I’m in DST or not. Using this method from the Joda Time library.

I’d like a solution that works in IE8 as well as the modern browsers. Any thoughts? Are there any small utilities that already accomplish this in a standard way?

// dateTimeAsString is sent from the server (via JSON) as a String
// dateTimeAsString example: "1311387300000"
var dateTimeAsInt = parseInt(dateTimeAsString,10);
var dateTimeInNY = new Date(dateTimeAsInt);

// My current offset is 240
var nyOffset = dateTimeInNY.getTimezoneOffset();

// Somewhere out west
var dateTimeInTexas = new Date(dateTimeAsInt);


var isDST = false; // sent from server


// What I want to do, this is not legal JavaScript
dateTimeInTexas.printWithOffset(isDST,nyOffset);
  • 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-25T18:34:00+00:00Added an answer on May 25, 2026 at 6:34 pm

    Browsers don’t have timezone information. They able to display only in UTC and in current OS timezone. Even it’s not guaranteed that a client has any knowledge about “America/New_York” timezone (e.g. a poor, weak mobile device).

    If you want display dates in a particular timezone, the easiest way it convert it to a formatted string and transfer it as a string, not milliseconds.

    If you need to do some calendar calculations on the client side, you are unlucky… You have to do it manually.

    BTW, you cannot use timezoneOffset as is, because it could be different for particular dates, DST is important too.

    So, first of all. What do you want to do with dates on the client side?

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

Sidebar

Related Questions

I have a mysql table that relies on the unix epoch time stamp equivalent
I have a time-stamp, which is returned from PayPal as 2010-12-29T20:42:49.929-08:00 Now I need
I'd like to use the folowing function to convert from Joda Time to Unix
I have timestamp in milliseconds from 1970. I would like to convert it to
I have a milliseconds-since-local-epoch timestamp that I'd like to convert into a milliseconds-since-UTC-epoch timestamp.
I have a time stamp I created with PHP that I would like to
i want to have a time stamp for logs on a Windows Mobile project
I essentially have a bunch of data objects which map timestamps in milliseconds to
I have a certain time in milliseconds (in a Timestamp object) and I want
I have this String: 1303317717.65384 - It's a UNIX timestamp (1303317717) with milliseconds (65384).

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.