Permalink
Browse files

javascript months are 0 based.

  • Loading branch information...
1 parent 3a64923 commit 8e3705fd76ad4b9bf2a577b913f435f9089fd1b9 @craiggwilson craiggwilson committed Jul 22, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 source/MongoDB/Util/JsonFormatter.cs
View
2 source/MongoDB/Util/JsonFormatter.cs
@@ -44,7 +44,7 @@ public static string SerializeForServerSide(object value)
if (value is DateTime)
{
DateTime d = (DateTime)value;
- sb.AppendFormat("new Date({0},{1},{2},{3},{4},{5},{6})", d.Year, d.Month, d.Day, d.Hour, d.Minute, d.Second, d.Millisecond);
+ sb.AppendFormat("new Date({0},{1},{2},{3},{4},{5},{6})", d.Year, d.Month - 1, d.Day, d.Hour, d.Minute, d.Second, d.Millisecond);
}
else
SerializeType(value, sb);

0 comments on commit 8e3705f

Please sign in to comment.