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. Visual Basic
  4. DateTimePicker

DateTimePicker

Scheduled Pinned Locked Moved Visual Basic
questionhelptutorial
2 Posts 2 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.
  • W Offline
    W Offline
    welbert
    wrote on last edited by
    #1

    Hi, How do i get the maximum number of days in a month using DateTimePicker? and how to display the current Time with a format (ex. 10:00 am)... and how to get the number of days from the first date that i picked until to the last date (ex. From : 01/12/06 To 01/14/06) result 2 days ? Pls i really need your help... thanks and more power... Welbert

    J 1 Reply Last reply
    0
    • W welbert

      Hi, How do i get the maximum number of days in a month using DateTimePicker? and how to display the current Time with a format (ex. 10:00 am)... and how to get the number of days from the first date that i picked until to the last date (ex. From : 01/12/06 To 01/14/06) result 2 days ? Pls i really need your help... thanks and more power... Welbert

      J Offline
      J Offline
      Joshua Quick
      wrote on last edited by
      #2

      welbert wrote:

      How do i get the maximum number of days in a month

      Date.DaysInMonth(theYear, theMonth)

      welbert wrote:

      how to display the current Time with a format (ex. 10:00 am)

      Set the following DateTimePicker properties in the designer... Format = Custom CustomFormat = h:mm tt See MSDN for more formatting codes. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandarddatetimeformatstrings.asp[^]

      welbert wrote:

      how to get the number of days from the first date that i picked until to the last date

      Get the selected date and time from the picker like this... Dim myDate As Date = myDateTimePicker.Value Get the number of days like this... myDate1.Subtract(myDate2).TotalDays

      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