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

Timezone support in server side javascript

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

      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.

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

              Created:
              Updated:
              Resolved: