Skip to content

Commit

Permalink
Fix to correctly render ISODate usec values; resolves iwind#124
Browse files Browse the repository at this point in the history
  • Loading branch information
maihde committed Jul 4, 2016
1 parent 939017a commit ff3140a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/classes/VarExportor.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private function _formatVarAsJSON($var, $jsonService) {
case "MongoDate":
$timezone = @date_default_timezone_get();
date_default_timezone_set("UTC");
$this->_jsonParams[$this->_paramIndex] = "ISODate(\"" . date("Y-m-d", $var->sec) . "T" . date("H:i:s.", $var->sec) . ($var->usec/1000) . "Z\")";
$this->_jsonParams[$this->_paramIndex] = "ISODate(\"" . date("Y-m-d", $var->sec) . "T" . date("H:i:s.", $var->sec) . sprintf("%03d", $var->usec/1000) . "Z\")";
date_default_timezone_set($timezone);
return $this->_param($this->_paramIndex);
case "MongoTimestamp":
Expand Down

0 comments on commit ff3140a

Please sign in to comment.