[CSHARP-645] Replace AsDateTime with ToLocalTime and ToUniversalTime in BsonValue (and related changes) Created: 11/Dec/12  Updated: 20/Mar/14  Resolved: 12/Dec/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: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Most of the AsXyz properties in BsonValue are simple casts that don't do any real conversion between types. But the AsDateTime and related properties actually do a type conversion because BsonDateTime and DateTime have different ranges and resolutions, as well the question of whether to convert to local or universal time.

The following changes will be made:

Deprecate AsDateTime: use ToLocalTime or ToUniversalTime instead
Deprecate AsNullableDateTime: use ToNullableLocalTime or ToNullableUniversalTime instead
Deprecate AsUniversalTime: use ToUniversalTime instead
Deprecate IsDateTime: use IsValidDateTime instead (aligns with property of the same name in BsonDateTime)



 Comments   
Comment by auto [ 12/Dec/12 ]

Author:

{u'date': u'2012-12-12T15:30:27Z', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-645: Replace AsDateTime with ToLocalTime and ToUniversalTime in BsonValue (and related changes).
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/e13c7ba4e808918baaef60099fe674f6845111ce

Generated at Wed Feb 07 21:37:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.