Home All Groups Group Topic Archive Search About

Retrieving the System date and time settings

Author
4 Jul 2006 8:56 AM
Tull Clancey
Hi all.

I'm having real trouble finding a simple solution for getting the system
date and time settings.

All I want to retrieve is the system short date format, is it dd/mm/yyyy or
mm/dd/yyyy or yyyy/mm/dd.  I can find many articles talking about changing
date formats, but nothing for actually getting the setting.

Anything would be gratefully received!  (VB.Net 2003/2005)

Cheers,
Tull.

Author
4 Jul 2006 10:01 AM
M. Posseth
well you may detect this with the DateTimeFormatInfo  class
http://msdn2.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.aspx

to get the current culture settings ( as you need this for the above )
http://msdn2.microsoft.com/en-us/library/system.threading.thread.currentculture.aspx


hth

Michel Posseth [MCP]






Show quoteHide quote
"Tull Clancey" wrote:

> Hi all.
>
> I'm having real trouble finding a simple solution for getting the system
> date and time settings.
>
> All I want to retrieve is the system short date format, is it dd/mm/yyyy or
> mm/dd/yyyy or yyyy/mm/dd.  I can find many articles talking about changing
> date formats, but nothing for actually getting the setting.
>
> Anything would be gratefully received!  (VB.Net 2003/2005)
>
> Cheers,
> Tull.
>
>
>
Author
8 Jul 2006 4:14 PM
Theo Verweij
The ease of VB:
just use: My.Application.Culture.DateTimeFormat

You'll have all you need (and a lot more!)

Tull Clancey wrote:
Show quoteHide quote
> Hi all.
>
> I'm having real trouble finding a simple solution for getting the system
> date and time settings.
>
> All I want to retrieve is the system short date format, is it dd/mm/yyyy or
> mm/dd/yyyy or yyyy/mm/dd.  I can find many articles talking about changing
> date formats, but nothing for actually getting the setting.
>
> Anything would be gratefully received!  (VB.Net 2003/2005)
>
> Cheers,
> Tull.
>
>
Author
10 Jul 2006 9:54 AM
Larry
Use Thread.CurrentCulture to get the settings.
You can google it to find it.

Larry



Show quoteHide quote
"Theo Verweij" <tverw***@xs4all.nl> wrote in message
news:%235COdnqoGHA.2268@TK2MSFTNGP04.phx.gbl...
> The ease of VB:
> just use: My.Application.Culture.DateTimeFormat
>
> You'll have all you need (and a lot more!)
>
> Tull Clancey wrote:
>> Hi all.
>>
>> I'm having real trouble finding a simple solution for getting the system
>> date and time settings.
>>
>> All I want to retrieve is the system short date format, is it dd/mm/yyyy
>> or mm/dd/yyyy or yyyy/mm/dd.  I can find many articles talking about
>> changing date formats, but nothing for actually getting the setting.
>>
>> Anything would be gratefully received!  (VB.Net 2003/2005)
>>
>> Cheers,
>> Tull.