Search This Blog

Google Analytics

Thursday, February 12, 2009

1234567890 Day - What's Your Local Date Time?

The below C# code determines your local date time to celebrate 1234567890 Day.

static void Main(string[] args)
{
    DateTime dateOn1Jan1970 = new DateTime(1970, 1, 1);
    int partySec = 1234567890;
    DateTime dateToParty = dateOn1Jan1970.AddSeconds(partySec);

    Console.WriteLine("UTC DateTime to party: " + dateToParty.ToUniversalTime().ToString());
    Console.WriteLine("Local DateTime to party: " + dateToParty.ToString());
}

No comments:

Post a Comment

Do provide your constructive comment. I appreciate that.

Popular Posts