|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Retrieving the System date and time settingsHi 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. 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. > > > 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. > > 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.
Is microsoft awaring VB.Net too hard to maintain?
Class used by multiple threads to write to Table Override Printer Margins (?) text/xml reporting service error Visual Studio .NET 2005 using Web Application Project DataGridView column sort WEB ENABLING a win application: best approach Serialize 3 levels of nested collections. Directory Listing view. SQL update statment, using ACCESS yes/no |
|||||||||||||||||||||||