How to convert Unix time in milliseconds to UTC in C#

1 Answer

0 votes
using System;

public class Program
{
    public static void Main(string[] args)
    {
        DateTimeOffset dateTimeOffset = DateTimeOffset.FromUnixTimeMilliseconds(10000000);
        
        Console.WriteLine(dateTimeOffset);
    }
}


 
/*
run:
   
01/01/1970 02:46:40 +00:00
   
*/

 



answered Jun 2, 2024 by avibootz

Related questions

1 answer 126 views
1 answer 102 views
1 answer 120 views
1 answer 136 views
...