How do you convert Unix epoch time into real time in C#? (Epoch beginning 1/1/1970)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
UPDATE 2024
In .NET core (>= 2.1)
UPDATE 2020
You can do this with DateTimeOffset
And if you need the
DateTimeobject instead ofDateTimeOffset, then you can call theDateTimepropertyOriginal answer
I presume that you mean Unix time, which is defined as the number of seconds since midnight (UTC) on 1st January 1970.