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

wtf?

Scheduled Pinned Locked Moved C#
helpquestion
7 Posts 6 Posters 3 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.
  • D Offline
    D Offline
    damianrda
    wrote on last edited by
    #1

    For some reason DateTime.DaysInMonth(2008, 4) returns 31, yet DateTime.Parse("2008-04-31") yields in a FormatException.. am i missing something here? or is this some sort of bug.

    N A S L 4 Replies Last reply
    0
    • D damianrda

      For some reason DateTime.DaysInMonth(2008, 4) returns 31, yet DateTime.Parse("2008-04-31") yields in a FormatException.. am i missing something here? or is this some sort of bug.

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      damianrda wrote:

      am i missing something here?

      Yeah, how to create a subject line that is meaningful and descriptive.


      only two letters away from being an asset

      1 Reply Last reply
      0
      • D damianrda

        For some reason DateTime.DaysInMonth(2008, 4) returns 31, yet DateTime.Parse("2008-04-31") yields in a FormatException.. am i missing something here? or is this some sort of bug.

        S Offline
        S Offline
        Stu Richardson
        wrote on last edited by
        #3

        Running the line of code you just mentioned returned 30 MessageBox.Show(DateTime.DaysInMonth(2008, 4).ToString()); `Sorry not much help there but I just thought id give you the result of my test. Very strange that it is returning 31 - it doesnt seem possible.`

        A 1 Reply Last reply
        0
        • D damianrda

          For some reason DateTime.DaysInMonth(2008, 4) returns 31, yet DateTime.Parse("2008-04-31") yields in a FormatException.. am i missing something here? or is this some sort of bug.

          A Offline
          A Offline
          Andrew Rissing
          wrote on last edited by
          #4

          Aside from the bad subject line, I'd say your problem is that its parsing your date assuming a YYYY-DD-MM format.

          1 Reply Last reply
          0
          • S Stu Richardson

            Running the line of code you just mentioned returned 30 MessageBox.Show(DateTime.DaysInMonth(2008, 4).ToString()); `Sorry not much help there but I just thought id give you the result of my test. Very strange that it is returning 31 - it doesnt seem possible.`

            A Offline
            A Offline
            Andrew Rissing
            wrote on last edited by
            #5

            Yeah, I assumed he fat fingered the date and meant March, but if you're talking about April - yeah...that's a problem ;D

            1 Reply Last reply
            0
            • D damianrda

              For some reason DateTime.DaysInMonth(2008, 4) returns 31, yet DateTime.Parse("2008-04-31") yields in a FormatException.. am i missing something here? or is this some sort of bug.

              L Offline
              L Offline
              led mike
              wrote on last edited by
              #6

              damianrda wrote:

              am i missing something here?

              Yes what Mark said and the fact that those two methods you posted have nothing to do with each other so your post is like saying, for some reason you can eat potatoes yet jumping off a building will hurt you.

              led mike

              G 1 Reply Last reply
              0
              • L led mike

                damianrda wrote:

                am i missing something here?

                Yes what Mark said and the fact that those two methods you posted have nothing to do with each other so your post is like saying, for some reason you can eat potatoes yet jumping off a building will hurt you.

                led mike

                G Offline
                G Offline
                Gareth H
                wrote on last edited by
                #7

                led mike, How tall is this building everyones jumping off?, I hope its not too big.. Regards, Gareth.

                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