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

Timezone support in server side javascript

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • JavaScript

    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

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

            Dates

              Created:
              Updated:
              Resolved: