Welcome to MSDN Blogs Sign in | Join | Help

Kathy Kam

Reflection on the CLR and .NET
Quiz of the Month: IsDaylightSavingTime() or not?

Question: Given your machine is in Pacific Time (PST) Time Zone, what is MainProgram.GetAnswer so that MainProgram.Test returns true?

class MainProgram

{

    static DateTime GetAnswer()

    {

         ????

    }

 

    static bool Test()

    {

        DateTime a = MainProgram.GetAnswer();

        String actual = String.Format("DateTime: {0}; IsDaylightSavingTime: {1}", a, a.IsDaylightSavingTime());

        String expected = "DateTime: 10/29/2006 1:30:00 AM; IsDaylightSavingTime: True";

        return (actual == expected);

    }

 

    static void Main(string[] args)

    {

    }

}

P.S. The answer will post in a week! I promised this time!

 

Note: Updated a clause here, that your machine needs to be in Pacific Time Zone

Posted: Friday, July 28, 2006 5:04 PM by KathyKam

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker