-Added JsonReader.ReadAsDateTimeOffset

-Fixed losing timezone information when deserializing DateTimeOffsets
This commit is contained in:
JamesNK
2010-09-12 03:39:39 +00:00
parent 11ce71ee8b
commit 235770442a
9 changed files with 245 additions and 30 deletions
@@ -318,6 +318,20 @@ namespace Newtonsoft.Json
return data;
}
#if !NET20
/// <summary>
/// Reads the next JSON token from the stream as a <see cref="DateTimeOffset"/>.
/// </summary>
/// <returns>A <see cref="DateTimeOffset"/>.</returns>
public override DateTimeOffset ReadAsDateTimeOffset()
{
DateTimeOffset dateTimeOffset = _reader.ReadAsDateTimeOffset();
ValidateCurrentToken();
return dateTimeOffset;
}
#endif
/// <summary>
/// Reads the next JSON token from the stream.
/// </summary>