Answer the question
In order to leave comments, you need to log in
How to convert DateTime to UNIX DateTime?
How to convert DateTime to UNIX DateTime?
And back
Answer the question
In order to leave comments, you need to log in
Use the function that is made for this
https://msdn.microsoft.com/ru-ru/library/system.da... DateTimeOffset.ToUnixTimeSeconds()
For example, the current time
PS: If you have a question about DateTime
DateTime foo = DateTime.Now;
long unixTime = ((DateTimeOffset)foo).ToUnixTimeSeconds();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question