Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Change system date style formate through codding

Change system date style formate through codding

Scheduled Pinned Locked Moved C#
helpquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Naveed727
    wrote on last edited by
    #1

    How can i change the system date style formate through code. I have a project when it starts it compare the current date withe the condition date is the date formate is wrong it give error plz help me out.

    I D P 3 Replies Last reply
    0
    • N Naveed727

      How can i change the system date style formate through code. I have a project when it starts it compare the current date withe the condition date is the date formate is wrong it give error plz help me out.

      I Offline
      I Offline
      imsathy
      wrote on last edited by
      #2

      http://www.microsoft.com/globaldev/getWR/steps/wrg_date.mspx[^] look into this !!

      Sathy

      N 1 Reply Last reply
      0
      • I imsathy

        http://www.microsoft.com/globaldev/getWR/steps/wrg_date.mspx[^] look into this !!

        Sathy

        N Offline
        N Offline
        Naveed727
        wrote on last edited by
        #3

        Thanks for providing such a good link. But my problem is not getting system data formate. Because in Microsoft.Win32 Api there is method GetSystemDateFormate but there is not Setting the System Date formate Can you help me out form this problem.

        1 Reply Last reply
        0
        • N Naveed727

          How can i change the system date style formate through code. I have a project when it starts it compare the current date withe the condition date is the date formate is wrong it give error plz help me out.

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #4

          You shouldn't change the system's format! Instead: 1. Retrieve the current date 2. Reformat it to the format you require 3. Compare If you use the DateTime.Parse() method you shouldn't even need to do this as it will handle all date and date/time formats for you.

          1 Reply Last reply
          0
          • N Naveed727

            How can i change the system date style formate through code. I have a project when it starts it compare the current date withe the condition date is the date formate is wrong it give error plz help me out.

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            You asked the same question yesterday and were informed that this was not a good idea back then. Why do you think you'll get a different answer today? The simple answer is that your application should not change the behaviour of the system to suit itself - this is a bad thing to do because you are upsetting the customer experience of the system. Instead, you need to bite the bullet and actually do some work yourself - if your code requires a particular date format, use the DateTime class to manage this in your code. This is the responsible, professional thing to do and you could have achieved this in the time you've spent faffing about trying to get people to tell you how to upset your users.

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups