4 ms·
A VB date literal is and always has been locale-independent. Originally, they did make the mistake of making it always US-style, M/D/Y. VB.NET added more sane f
by int_19h 4y ago
A VB date literal is and always has been locale-independent. Originally, they did make the mistake of making it always US-style, M/D/Y. VB.NET added more sane formats such as YYYY-MM-DD.
Now if you tried to convert a Date value to String at runtime, yeah, that would use the current locale. That was a constant source of bugs in VB6 apps running on non-US locales (including, famously, at least one Microsoft installer).
- jameshart 4y agoAre you sure? Maybe for Visual Basic proper, but I thought the VBA date literal basically followed Excel date parsing rules, so was localized depending on your office inatall.
- jameshart 4y agoApparently I'm misremembering: https://www.engram9.info/excel-2007-vba-2/date-literals.html https://www.engram9.info/excel-2007-vba-2/date-literals.html Still, this violates the principle of least surprise for non-american developers, at least, so seems pretty on brand for VB.