Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6456

Timezone support in server side javascript

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: JavaScript
    • Labels:

      Description

      According to the docs, dates should be stored as UTC in mongodb. (At least pymongo suggests that and implicitly converts timezone aware datetimes to UTC.)

      However, in order to be able to group by days in a local timezone, some way to convert the Date() to a specific timezone in serverside javascript should be provided.

      E.g. a grouping function like...
      -------------------- 8< --------------------
      function(d) {
      return

      { 'date': new Date( d.uploadDate.getFullYear(), d.uploadDate.getMonth(), d.uploadDate.getDate()) }

      ;
      };
      -------------------- 8< --------------------
      ... won't work, if the timestamps are saved in UTC but grouping should be done by local days.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            tuxator Leo Bergolth
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: