Results 1 to 4 of 4

Thread: Changing the date format in regional settings...

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    Cow Town, AB, Canada
    Posts
    5

    Angry

    How the h*ll do i change the format of the system date in
    the regional settings via VB6 code?

    M.

  2. #2
    Hyperactive Member
    Join Date
    Feb 2000
    Posts
    284
    Have you tried either of the following API calls


    Public Declare Function SetSystemTime Lib "kernel32" Alias "SetSystemTime" (lpSystemTime As SYSTEMTIME) As Long
    Public Declare Function SetSystemTimeAdjustment Lib "kernel32" Alias "SetSystemTimeAdjustment" (ByVal dwTimeAdjustment As Long, ByVal bTimeAdjustmentDisabled As Boolean) As Long


    Public Declare Function SetTimeZoneInformation Lib "kernel32" Alias "SetTimeZoneInformation" (lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    Cow Town, AB, Canada
    Posts
    5
    still don't know what you mean...

    how do i use these functions, give me an example of how to change the system date from dd/MM/yy to MM/dd/yyyy

    i can work with an example..

    thanx

    M.


  4. #4
    Member
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    39
    Hi Mr_Pickles...

    Try these codes..

    Private Declare Function SetLocaleInfo Lib "KERNEL32" Alias "SetLocaleInfoA" _
    (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String) As Long

    Private Const LOCALE_USER_DEFAULT = &H400
    Private Const LOCALE_SSHORTDATE = &H1F 'short date format string

    '--This will change the default date format
    SetTime = SetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE, "MM/dd/yyyy")


    [Edited by tomtan on 07-28-2000 at 09:31 PM]
    ThOmaS TaN

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width