0

I can't get my head around on how to convert something like

1332953228 -14400

to first-class System.DateTime object. This value actually comes from Mercurial an when displayed on the UI is seen as

Wed Mar 28 20:47:08 2012 +0400

1 Answer 1

1

I'm not sure exactly how you should handle the timezone offset, but Unix Time is number of seconds since 1/1/1970. This seems close, though like I said I'm not sure about the offset:

var theDate = new DateTimeOffset(new DateTime(1970, 1, 1).AddSeconds(1332953228), TimeSpan.FromSeconds(-14400));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.