Results 1 to 3 of 3

Thread: Dates

  1. #1
    Join Date
    Mar 2011

    Angry Dates

    I hate dates

    So, I have stored dates in my SQL database using GETUTCDATE() which appears to be working fine.
    I then created a function that basically gets the JavaScript milliseconds for any date I store. This was simply for doing sorting and filtering.

    So, when I create a new Date() object in JavaScript using my milliseconds and call the toLocaleString() function, I get something like:

    Tue Oct 30 2012 01:37:57 GMT+0000 (GMT STANDARD TIME)

    now, what I would like is this.
    I want it to show something like :

    Tue Oct 30 2012 01:37:57

    and if the person viewing my site has their regional settings set to GMT + 0200 I want the time to be displayed for them in their region:

    Tue Oct 30 2012 03:37:57

    I have been searching for ages and I just can't find anything to do it.
    I thought that date.js would work, but it can't handle the "(GMT STANDARD TIME)" which is a shame.

    Any help would be greatly appreciated.


  2. #2
    Join Date
    Dec 2005


    I'm not sure I understand your problem.
    When I run the following script, I get exactly what you want...
    <title> Untitled </title>
    <script type="text/javascript">
    var now = new Date();
    The time displays for my own time zone without any adjustments.

    Do you have an example that shows the error you are getting?
    Is you browser set-up to show something different?

  3. #3
    Join Date
    Mar 2011
    it appears to be a problem in chrome:


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center