Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB.Net DateTime class '#' Symbol

Recently I've been doing quite the project mostly working with the DateTime class.

Now,.. I've found a snip of code on the internet as follows:

Const _dt7am As DateTime = #7:00:00 AM#

and I'm just curious to ask what does the # sign do in this syntax?

typing in '#' on Google just brings up everyone's asking's about Preprocessor statements


1 Answers

# delimits a date, much like " delimits a string. Just typing:

Const _dt7am As DateTime = 7:00:00 AM

won't work, of course. # is just what you wrap your date literals with in VB.NET.

like image 145
Ry- Avatar answered Feb 01 '26 03:02

Ry-