This file contains 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
using System; | |
using System.Text.RegularExpressions; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html |
This file contains 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; | |
Regex regex = new System.Text.RegularExpressions.Regex(@"^\/date\((\d*)([\+\-]?\d*)\)\/+$"); |
NewerOlder