Determining System Date Format


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Determining System Date Format

  1. #1
    MIke Guest

    Determining System Date Format


    I am using a lot of date manuplaction in my project so I want the system date
    to be in a specific order when entering the project. I am using the SetLocaleInfo()
    function to set the date format but I need a way of determining the date
    format before I set it to what I want so I can reverse the process when leaving
    the project.
    I am trying to use the function GetLocaleInfo() function but I can not get
    this function to work proper. Having problems determining the values I should
    put in function.
    ************************************
    Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale
    As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As
    Integer) As Long
    *************************************
    I know How to Figure out the Locale but Am lost on the rest of the values..

    Please Help...


  2. #2
    Russell P. Holsclaw Guest

    Re: Determining System Date Format

    Why are you wanting to mess with the user's preferences for date formats?

    If your program has dependencies on data strings in a particular format,
    then just convert them to that form _INTERNALLY_. It's not right to change
    the user's preferences just to conform to the internal needs of one
    application program. I'd say it borders on "immoral".

    What are you trying to accomplish, exactly?

    Internally, the system date is always in the same binary format. The
    locale-based preferences are just a way of telling applications how dates,
    times, etc, are to be converted into character strings to conform to the
    user's linguistic/cultural norms.

    Leave them alone.

    --
    Russ Holsclaw
    "MIke" <mkdaa@fundy.net> wrote in message news:3c17712e$1@147.208.176.211...
    >
    > I am using a lot of date manuplaction in my project so I want the system

    date
    > to be in a specific order when entering the project. I am using the

    SetLocaleInfo()
    > function to set the date format but I need a way of determining the date
    > format before I set it to what I want so I can reverse the process when

    leaving
    > the project.
    > I am trying to use the function GetLocaleInfo() function but I can not get
    > this function to work proper. Having problems determining the values I

    should
    > put in function.
    > ************************************
    > Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal

    Locale
    > As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As
    > Integer) As Long
    > *************************************
    > I know How to Figure out the Locale but Am lost on the rest of the

    values..
    >
    > Please Help...
    >



  3. #3
    Bob Butler Guest

    Re: Determining System Date Format


    "MIke" <mkdaa@fundy.net> wrote in message news:3c17712e$1@147.208.176.211...
    >
    > I am using a lot of date manuplaction in my project so I want the system

    date
    > to be in a specific order when entering the project. I am using the

    SetLocaleInfo()
    > function to set the date format but I need a way of determining the date
    > format before I set it to what I want so I can reverse the process when

    leaving
    > the project.


    If you want a specific date format for entry then validate the user's entry
    yourself. Don't muck with the user's preferences.

    You should be working internally just using Date types and the in/out
    formats should never matter to you.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center