An odd date format display problem in ActiveX components of VB6

Source: Internet
Author: User

Environment: Windows Server 2003

In the language and region settings, the region has been set to the United States, and the date format is "mm/DD/YYYY". However, in the Active x dll of VB6, the format $ (now, "Short date") the date format is always "DD/MM/YYYY", which cannot be understood. Using ASP, a simple EXE is made with VB6.Program, The displayed formatted date format is correct, that is, the DLL does not work... Google won't find a direct answer, but found several windows APIs, inspired, two of which are:

Getsystemdefaultlcid

Getuserdefaultlcid

Obtain the default lcid of the system and the user. After calling these two APIs, the system is 1033 and the user is 1027. set Session on ASP page. after lcid = 1027, the date format is changed to dd/mm/yyyy. It seems that the format function in ActiveX dll uses user region settings instead of system region settings, in Windows, the region and language settings appear to be system-level regional settings. How can we synchronize users with the system?

Control Panel-> area and language options-> Advanced tab->

"Apply all settings to the current user account and default user configuration file", check and click "Apply.

Q: How can I set the region settings for a user separately? I don't know, but this is enough to solve the problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.