Retrieving the System date and time settings

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tull Clancey

    #1

    Retrieving the System date and time settings

    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.


  • M. Posseth

    #2
    RE: Retrieving the System date and time settings

    well you may detect this with the DateTimeFormatI nfo class

    http://msdn2.microsoft.com/en-us/lib...ormatinfo.aspx

    to get the current culture settings ( as you need this for the above )

    http://msdn2.microsoft.com/en-us/lib...ntculture.aspx


    hth

    Michel Posseth [MCP]






    "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.
    >
    >
    >

    Comment

    • Theo Verweij

      #3
      Re: Retrieving the System date and time settings

      The ease of VB:
      just use: My.Application. Culture.DateTim eFormat

      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.
      >
      >

      Comment

      • Larry

        #4
        Re: Retrieving the System date and time settings

        Use Thread.CurrentC ulture to get the settings.
        You can google it to find it.

        Larry



        "Theo Verweij" <tverweij@xs4al l.nlwrote in message
        news:%235COdnqo GHA.2268@TK2MSF TNGP04.phx.gbl. ..
        The ease of VB:
        just use: My.Application. Culture.DateTim eFormat
        >
        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.

        Comment

        Working...