-
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...
-
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...
>
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks