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. Web Development
  3. ASP.NET
  4. Am I right?

Am I right?

Scheduled Pinned Locked Moved ASP.NET
sysadminquestion
3 Posts 3 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.
  • C Offline
    C Offline
    cloudking11966
    wrote on last edited by
    #1

    I am storing date in a textbox as well as pre popualte. But it sometimes give InvalidCastException while converting to my required format when I port it into production server(Server has different Date Time format) So I fixed the culture to some fixed culture which uses dd/mm/yyyy format(du-AT) Now all fine it does not give any exception in either of the place, but I still wonder is that the right way!!!

    G D 2 Replies Last reply
    0
    • C cloudking11966

      I am storing date in a textbox as well as pre popualte. But it sometimes give InvalidCastException while converting to my required format when I port it into production server(Server has different Date Time format) So I fixed the culture to some fixed culture which uses dd/mm/yyyy format(du-AT) Now all fine it does not give any exception in either of the place, but I still wonder is that the right way!!!

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      You can specify the culture in the call when you parse the date. You can also use ParseExact to parse a specific format. --- b { font-weight: normal; }

      1 Reply Last reply
      0
      • C cloudking11966

        I am storing date in a textbox as well as pre popualte. But it sometimes give InvalidCastException while converting to my required format when I port it into production server(Server has different Date Time format) So I fixed the culture to some fixed culture which uses dd/mm/yyyy format(du-AT) Now all fine it does not give any exception in either of the place, but I still wonder is that the right way!!!

        D Offline
        D Offline
        Daniel Santillanes
        wrote on last edited by
        #3

        You could also use a date chooser control instead of a regular text box. One option is: Excentrics World[^] But there are many others. daniero

        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