How to enter DateTime value in VS QuickWatch window?

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

+3
source share
2 answers

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

#1/29/2009#
+2
source

The Year / Month / Hour / etc fields in DateTime are immutable. You cannot change them in QuickWatch. You can change it only by reassignment. Just change the value by building a new one. In other words, enter “new DateTime (2009, 29, 1)” in the “Value” section.

+9
source

Source: https://habr.com/ru/post/1702392/


All Articles