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. Other Discussions
  3. The Weird and The Wonderful
  4. What will you call this???

What will you call this???

Scheduled Pinned Locked Moved The Weird and The Wonderful
questionworkspace
23 Posts 12 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.
  • A AhsanS

    It contains "DD MMM YYYY HH:mm:ss"

    Ahsan Ullah Senior Software Engineer MCTS 2.0

    P Offline
    P Offline
    PIEBALDconsult
    wrote on last edited by
    #21

    Then the format is changed too.

    1 Reply Last reply
    0
    • A AhsanS

      Assume that pTimeText is containing 2 dates seperated by space. Like pTimeText = "31/12/2008 15:36 29/12/2008 15:36"

      this.txtTime.Text = Convert.ToDateTime(pTimeText.Substring(0, pTimeText.IndexOf(":") + 3)).ToString(Logic.DateConfigurer.DateFormatWithTime) + Environment.NewLine + Convert.ToDateTime(pTimeText.Substring(pTimeText.IndexOf(":") + 3)).ToString(Logic.DateConfigurer.DateFormatWithTime);

      Guess what will above code return. I found it in a file.

      Ahsan Ullah Senior Software Engineer

      C Offline
      C Offline
      cliran
      wrote on last edited by
      #22

      Code Reviewer: "wtf dude?!" Programmer: "ah... but it works!" indeed, if code written like THIS can actually work, than there must be some king of supreme being..

      1 Reply Last reply
      0
      • A AhsanS

        Assume that pTimeText is containing 2 dates seperated by space. Like pTimeText = "31/12/2008 15:36 29/12/2008 15:36"

        this.txtTime.Text = Convert.ToDateTime(pTimeText.Substring(0, pTimeText.IndexOf(":") + 3)).ToString(Logic.DateConfigurer.DateFormatWithTime) + Environment.NewLine + Convert.ToDateTime(pTimeText.Substring(pTimeText.IndexOf(":") + 3)).ToString(Logic.DateConfigurer.DateFormatWithTime);

        Guess what will above code return. I found it in a file.

        Ahsan Ullah Senior Software Engineer

        M Offline
        M Offline
        Megidolaon
        wrote on last edited by
        #23

        *points and laughs* Pointless. Really. The DateTime class can can convert a string to date. Separating the both dates must be done manually, but the conversion can be done by the DateTime class.

        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