Expected input format for DateTime
What is expected input format for DateTime parameter? I'm getting 1/1/0001 12:00:00 AM as a result whatever format I try!?
Can you post what you've tried? 2017-01-10 12:10:15 works fine for me, among other formats.
2017-01-10 12:10:15 doesn't work completely, it only parses the date part and ignores the time part, most likely because of the whitespace.
The ISO 2017-01-10T12:10:15 will work, but is inconsistent with the "usage" preview for datetime.
When including an Option that is DateTime type in the Usage help preview, it displays yet another format (that can't be parsed) as an argument for the example: --start 10/23/2018 2:28:28 PM
This could be rather confusing for program user if you are relying on the usage help instructions to provide a parse-able date format.
@dwoodruff83 it does parse the time, you just have to quote it first:
--start "10/23/2018 2:28:28 PM"
--start "2017-01-10 12:10:15"
Good point though, the FormatCommandLine method does not properly quote the text.
Wow, @nemec , I feel so stupid now. I did the same thing for a file path with spaces in it and I never even thought to try it for date. Thanks for clarifying and setting me straight!!