SetVarConversionLocaleSetting function

Sets National Language Support (NLS) flags to a specific locale for use when converting the date and time for the current user and computer.

Syntax

HRESULT SetVarConversionLocaleSetting(
  _In_ ULONG dwFlags
);

Parameters

dwFlags [in]

Determines the locale to use for date and time conversion. The values in the following table are used for this flag.

Value Meaning
0
The default value. It uses the locale set by the last user or process that set the cache.
1
Format is based on the current identity of the thread requesting these values. The current identity is based on the identity of the thread that makes the call to OleAut32.dll.
2
Format is forced to use the system default regional settings. The system default settings are set for a computer at reboot. In this case, the date format is not read from the registry but from the Locale.nls file for that locale.
[!Note]
Changing the default locale changes all regional settings (time, money, date formats, and so on). There is no way to modify a specific setting within the locale.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Library
OleAut32.lib
DLL
OleAut32.dll

See also

GetVarConversionLocaleSetting