Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting the windows date format through VB

Status
Not open for further replies.

ndalli

Programmer
Nov 6, 1999
76
MT
Hi,

Does anyone knows how I can set the windows date format to for example dd/mm/yyyy, through VB?

Thanks in advance
 
Take a look at the SetLocaleInfo WinAPI call.

Public Declare Function SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String) As Long


To get the info use GetLocaleInfo like:

lBuffLen = 128
sBuffer = String$(lBuffLen, vbNullChar)

lResult = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE, sBuffer, lBuffLen)
Mind Flayer
---
MindXFlayer@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top