This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Convert to DateTimeOffset from Json Date(Unix epoch) | |
/// </summary> | |
/// <param name="jsondate">ex: "/Date(1324707957994+0900)/"</param> | |
/// <returns></returns> | |
public Nullable<DateTimeOffset> ConvertToDateTimeOffsetFromJsonDate(string jsondate) | |
{ | |
if (String.IsNullOrEmpty(jsondate)) return null; | |
var match = Regex.Match(jsondate, @"^\/date\((\d*)([\+\-]?\d*)\)\/+$", RegexOptions.IgnoreCase); |