Description of the setlocale function in the VBS document:
Sets the global locale and returns the previous locale.
A locale is a collection of user reference information, which is related to the user's language, country/region and cultural tradition. The locale determines the keyboard layout, alphabetical sort order, and date, time, number, and currency format.
Simply put, the return value of some functions in the VBS is related to the current locale, such as the MonthName function:
Copy Code code as follows:
Dim A (a), B (12)
' By Demon
SetLocale "ZH-CN"
For i = 1 to 12
A (i) = MonthName (i)
Next
SetLocale "en-US"
For i = 1 to 12
B (i) = MonthName (i)
Next
For i = 1 to 12
WScript.Echo A (i), B (i)
Next
Another example is the format of dates and times:
Copy Code code as follows:
' By Demon
SetLocale "ZH-CN"
WScript.Echo CStr (now)
SetLocale "en-US"
WScript.Echo CStr (now)
SetLocale "De-de"
WScript.Echo CStr (now)
Of course, there are other functions, I do not have time to tidy up, welcome message added.
Author: Demon
Link: http://demon.tw/programming/vbs-setlocale-function.html