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. Date Diff... ? [modified]

Date Diff... ? [modified]

Scheduled Pinned Locked Moved C#
question
4 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.
  • P Offline
    P Offline
    pakpatel
    wrote on last edited by
    #1

    I have Date.. which is user input by using " DateTimePicker " ... But now i want to make sure this user is uder 18 year or not... So what should do ? -Thanks

    Peter

    modified on Thursday, April 3, 2008 2:48 PM

    P G 2 Replies Last reply
    0
    • P pakpatel

      I have Date.. which is user input by using " DateTimePicker " ... But now i want to make sure this user is uder 18 year or not... So what should do ? -Thanks

      Peter

      modified on Thursday, April 3, 2008 2:48 PM

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

      pakpatel wrote:

      But now i want to chek if this user is uder 18 year or not

      There is no way to tell without meeting in person, and even then it can be iffy. Whenever a Website asks for my birthdate I use 1900-01-01 and watch what happens.

      1 Reply Last reply
      0
      • P pakpatel

        I have Date.. which is user input by using " DateTimePicker " ... But now i want to make sure this user is uder 18 year or not... So what should do ? -Thanks

        Peter

        modified on Thursday, April 3, 2008 2:48 PM

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

        pakpatel wrote:

        But now i want to chek if this user is uder 18 year or not

        That is not possible with the information given. You can check if the date entered is at least 18 years ago. Just take the current date, subtract 18 years from it, and compare the dates: if (enteredDate <= DateTime.ToDay.AddYears(-18)) ...

        Despite everything, the person most likely to be fooling you next is yourself.

        P 1 Reply Last reply
        0
        • G Guffa

          pakpatel wrote:

          But now i want to chek if this user is uder 18 year or not

          That is not possible with the information given. You can check if the date entered is at least 18 years ago. Just take the current date, subtract 18 years from it, and compare the dates: if (enteredDate <= DateTime.ToDay.AddYears(-18)) ...

          Despite everything, the person most likely to be fooling you next is yourself.

          P Offline
          P Offline
          pakpatel
          wrote on last edited by
          #4

          Thnks For Your Help.. I get it

          Peter

          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