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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:53:03+00:00 2026-05-27T20:53:03+00:00

I store dates on server side in UTC timezone. When client (browser) wants to

  • 0

I store dates on server side in UTC timezone.
When client (browser) wants to pass some date to server it sends date like

"Tue Jan 03 2012 16:50:32 GMT+0400 (Russian Standard Time)"
  1. Is this format standard across all browsers?
  2. If 1. is false, how can I redefine the Date format function? Is this a good practice?
  3. How can I convert JS Dates to a UTC java.util.Date with java.text.SimpleDateFormat?

UPDATE

I thought that passing date as formatted string (with timezone part) will cause less headache since I shouldn’t bother to convert dates to UTC on client side. So I avoid any date conversions in JS code.

  • 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-27T20:53:04+00:00Added an answer on May 27, 2026 at 8:53 pm

    You should send the number of milliseconds since epoch (1 Jan 1970 UTC) that is available via the + prefix operator as in +new Date(2012, 0, 1).

    Sending anything with a timezone requires both machines to have the same timezone definitions which means you will likely end up with subtle bugs where two dates occurred in one order on one machine but in a different order on another. You can eliminate that whole class of bugs by using the millis since epoch representation.

    To answer your questions:

    Is this format standard across all browsers?

    Date.prototype.toString and toUTCString are both implementation dependent but toISOString is reliable.

    http://es5.github.com/#x15.9.5.43

    15.9.5.43 Date.prototype.toISOString ( ) # Ⓣ Ⓡ

    This function returns a String value represent the instance in time represented by this Date object. The format of the String is the Date Time string format defined in 15.9.1.15. All fields are present in the String. The time zone is always UTC, denoted by the suffix Z. If the time value of this object is not a finite Number a RangeError exception is thrown.

    15.9.1.15 Date Time String Format # Ⓣ Ⓔ Ⓑ

    ECMAScript defines a string interchange format for date-times based upon a simplification of the ISO 8601 Extended Format. The format is as follows: YYYY-MM-DDTHH:mm:ss.sssZ

    Whereas http://es5.github.com/#x15.9.5.2 says

    15.9.5.2 Date.prototype.toString ( ) # Ⓣ Ⓡ

    This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the Date in the current time zone in a convenient, human-readable form.

    http://es5.github.com/#x15.9.1.15

    15.9.5.42 Date.prototype.toUTCString ( ) # Ⓣ Ⓡ

    This function returns a String value. The contents of the String are implementation-dependent, but are intended to represent the Date in a convenient, human-readable form in UTC.

    NOTE The intent is to produce a String representation of a date that is more readable than the format specified in 15.9.1.15. It is not essential that the chosen format be unambiguous or easily machine parsable. If an implementation does not have a preferred human-readable format it is recommended to use the format defined in 15.9.1.15 but with a space rather than a “T” used to separate the date and time elements.

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

Sidebar

Related Questions

We store all our dates SQL Server 2008 database in UTC time in DateTime
I'm using MS SQL Server 2005 and I need to store date values partially.
I have legacy DB that store dates that means no-date as 9999-21-31, The column
I store some dates in my NSMutableArray, I want to retrieve them and change
What's the best way to store timezone information with dates/times in a uniform way
I'm getting dates & times from various sources (e.g. file's date/time from FTP server,
I have a user created button to send data from store to server side
If I store all my dates in SQL Server 2005 as GetUtcDate() what is
In Code-behind: I store my Dates in SQL Server with DateTime.ToUniversalTime() . I then
I am using MS SQL Server 2005, I have dates stored in epoch time

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.