Uploaded image for project: 'PHP Legacy Driver'
  1. PHP Legacy Driver
  2. PHP-956

timezone Problem with $dayOfMonth

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Works as Designed
    • Affects Version/s: 1.4.5
    • Fix Version/s: None
    • Component/s: pecl-mongo
    • Labels:
      None
    • Environment:
      Debian, PHP 5.4.24
    • # Replies:
      5
    • Last comment by Customer:
      false

      Description

      Code Details:
      $dateStart = new MongoDate(strtotime("2014-01-01 00:00:00"));
      $dateEnd = new MongoDate(strtotime("2014-12-31 23:59:59"));
      array(
      array('$match' => array('regdate' => array('$gt' => $dateStart, '$lt' => $dateEnd))),
      array('$project' => array('day' => array('$dayOfMonth' => '$regdate'))),
      array('$group' => array('_id' => array('day' => '$day'), 'count' => array('$sum' => 1))),
      array('$sort' => array('_id.day' => -1)),
      );

      In my Testcase, a User registred at 0:08 (UTC +1) not 23:08 (UTC +0, MongoDB Default).

      So the user didn't count to the Day.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              Bodenhaltung Bodenhaltung [X] (Inactive)
              Participants:
              Last commenter:
              Rathi Gnanasekaran
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                6 years, 32 weeks, 2 days ago
                Date of 1st Reply: