[CSHARP-567] Improvements to BsonDateTime class Created: 10/Sep/12 Updated: 14/May/14 Resolved: 11/Sep/12 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.7 |
| Fix Version/s: | 1.8 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Robert Stam | Assignee: | Craig Wilson |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Minor Change | ||||||||
| Description |
|
Make a few small improvements to BsonDateTime:
The reason we are going to require that the DateTime passed to the constructor already be in UTC is to emphasize that the database only stores UTC values. If you are passing a local time you probably have a bug anyway (or at least would have wondered why the value you got back when reading it back from the database was different), and this exception alerts you to the fact that you are not working in UTC as required by MongoDB. Recommended changes if you were are affected by any of these:
|
| Comments |
| Comment by auto [ 11/Dec/12 ] |
|
Author: {u'date': u'2012-09-11T15:37:29Z', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: Conflicts: |
| Comment by auto [ 11/Sep/12 ] |
|
Author: {u'date': u'2012-09-11T08:37:29-07:00', u'email': u'craiggwilson@gmail.com', u'name': u'Craig Wilson'}Message: |
| Comment by Robert Stam [ 10/Sep/12 ] |
|
Related to this change, also remove AsLocalTime and AsUniversalTime from BsonValue. The workarounds are identical to those presented above for ToLocalTime and ToUniversalTime. |