This section provides rules on writing date and time literals, characters enclosed in hash signs. VBScript support several formats for the date string like ISO format and US format.
In the previous section, we learned that a date literal is a string representing a date and/or time enclosed in hash signs (#).
Here are some details about how to write a date and/or time literal:
You can write a date literal with the date part only, like #31-Dec-1999#.
You can write a date literal with the time part only, like #21:26:00#.
You can write a date literal with both date and time parts, like #31-Dec-1999 21:26:00#.
You can also write a date literal with the ISO format, like #1999-12-31 21:26:00#.
You can also write a date literal with the US format, like #12/31/1999 9:26:00 PM#.
You can NOT write a date literal with milliseconds, like #31-Dec-1999 21:26:00.123#.
Here is a tutorial example on how to write date and time in different formats: