Results 1 to 11 of 11

Thread: Set Date Format??

  1. #1

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565

    Question

    Anybody out there know how I can set the system date format in code? Some API or something??
    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Cheers, but not quite what I want.

    I want to change the format of the system date, not the actual date value.
    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

  4. #4
    Lively Member
    Join Date
    Sep 1999
    Location
    Liverpool, UK
    Posts
    64
    There is a registry key for date formats...

    HKEY_CURRENT_USER\Control Panel\International\sLongDate
    HKEY_CURRENT_USER\Control Panel\International\sShortDate

    You can also modify the entries in the win.ini file. You might need a reboot for these changes to take effect though.


  5. #5

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Cheers, I could use these and force the user to re-boot, but I think that would be a bit too much for the users.

    Anybody else have a way, where I don't have to re-boot?
    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

  6. #6
    Lively Member
    Join Date
    Sep 1999
    Location
    Liverpool, UK
    Posts
    64
    It might work without a reboot, that was only a guess...

    Can I ask why you need to change the date format anyway ?

  7. #7

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    All the machines in the company are set to English, but sometimes when something goes wrong with the machine it sets itself back to American, which screws up the existing software.

    Now setting the format is a hastle as the users do not have the required permissions to do this themselves, so they have to phone somebody to do it (which usually takes a day).

    Usually the affected software will just show an error message indicating that the user needs to have the format changed, but instead of going through all the delay, it would be nice if I could just change it when it is detected instead.

    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

  8. #8
    Lively Member
    Join Date
    Sep 1999
    Location
    Liverpool, UK
    Posts
    64

    Talking

    You can use the API 'SetLocaleInfo' to set the date and time formats.

  9. #9

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Cheers, I'll give that a go.
    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

  10. #10
    Lively Member
    Join Date
    Sep 1999
    Location
    Liverpool, UK
    Posts
    64
    Just done a quick search and found this example of it....

    http://vb.ora.com/ron/short_date.html


    better do some work myself...

  11. #11

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Superb, thanks for all the help.
    VB6 sp5, SQL Server 2000, C#

    There are no stupid questions. Only stupid people.

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