Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,938 questions

51,875 answers

573 users

How to convert integer date to DateTime in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            DateTime dt1 = DateTime.FromOADate(42753);
            Console.WriteLine(dt1);

            DateTime dt2 = DateTime.FromOADate(41898);
            Console.WriteLine(dt2);

            DateTime dt3 = DateTime.FromOADate(39123);
            Console.WriteLine(dt3);

            DateTime dt4 = DateTime.FromOADate(36579);
            Console.WriteLine(dt4);
        }
    }
}

/*
run:
   
18/01/2017 00:00:00
16/09/2014 00:00:00
10/02/2007 00:00:00
23/02/2000 00:00:00

*/

 



answered Jan 18, 2017 by avibootz

Related questions

1 answer 88 views
1 answer 128 views
1 answer 107 views
3 answers 161 views
3 answers 269 views
269 views asked Sep 12, 2020 by avibootz
2 answers 156 views
...