I would like to find out what is set up as the "First Day of the Week" for a certain Windows system.
I think when I pass vbUseSystemDayOfWeek to Weekday(), VB gets this setting somehow.
I would like to ask how I could get to know it, too.
Thank you!
ps: The original reason for my question is the following:
My application is multilingual. It contains a calendar. I can easily fill the weekday names using WeekdayName(Weekday()), etc.
However, this only works for the current Windows language: The returned Weekday names are in the language of the OS.
I would like to get the weekday names for other languages to. So I have to first find out which weekday a given date is.
Since this depends on the First Day of the Week that is setup in Windows, I would have to retrieve this value something.
Monday is the first day of the week according to the international standard ISO 8601, but in the US, Canada, and Japan, it's counted as the second day of the week. Monday comes after Sunday and before Tuesday in our modern-day Gregorian Calendar.
Do you know what I mean? The argument "vbUseSystemDayOfWeek" causes the function to look internally what the first day of the week is in the system.
I would also like to know about this.
How could I do this? I haven't found any API function that would tell me.
There can theoretically be two values for each locale and user. There is the setting the system defaults to for the locale, and a possibly user-overridden effective value. If there has been an override than that is what normally gets used.
I would not be surprised to find that some users go into the system settings and override various settings in order to make some half-baked program(s) work.
As far as looking day names up you have to consider both the language and the region. In theory two German-speaking countries might use different names for Sunday. Locale ID values handle this by having a language and a sublanguage part.
The demo attached contains calls to GetLocaleInfo(). You can pare it back to the minimum you need for a given program. I generally keep it intact as it is.