Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Private Declare Function GetUserDefaultLCID Lib "kernel32" () As Long
Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long
Private Declare Function SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String) As Long
Const LOCALE_SSHORTDATE = &H1F
Public Function GetShortDate() As String
Dim sLen As Long
Dim sDate As String * 32
sLen = GetLocaleInfo(GetUserDefaultLCID(), LOCALE_SSHORTDATE, sDate, 64)
GetShortDate = Left$(sDate, sLen - 1)
End Function
Public Function SetShortDate(NewFormat As String) As String
SetLocaleInfo GetUserDefaultLCID(), LOCALE_SSHORTDATE, NewFormat
End Function
Private Sub Form_Load()
MsgBox "ShortDateFormat is " & GetShortDate
End Sub