Kevin
Kevin

Reputation: 4747

How do I enter a DateTime value in the VS QuickWatch window?

I am trying to change some DateTime data in a QuickWatch window. I have tried 1/29/2009, etc. but none of them seem to work. It just keeps going back to #12:00:00 AM#.

Upvotes: 3

Views: 3895

Answers (2)

David Morton
David Morton

Reputation: 16505

The Year/Month/Hour/etc fields in DateTime are immutable. You can't change them in QuickWatch. You can only change it by reassigning. Just change the value by constructing a new one. In other words, enter "new DateTime(2009, 29, 1)" in the Value section.

Upvotes: 10

Joey
Joey

Reputation: 2951

Put it inside of pound symbols (#) Like...

#1/29/2009#

Upvotes: 2

Related Questions