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. How to ( - ) the date of the last to give me output Py days

How to ( - ) the date of the last to give me output Py days

Scheduled Pinned Locked Moved Visual Basic
tutorial
4 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.
  • A Offline
    A Offline
    Ahmed El Badry
    wrote on last edited by
    #1

    like dim days as integar days = Date.Now.ToShortDateString - any date.ToShortDateString

    Ahmed El-Badry

    C 1 Reply Last reply
    0
    • A Ahmed El Badry

      like dim days as integar days = Date.Now.ToShortDateString - any date.ToShortDateString

      Ahmed El-Badry

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      days = (DateTime.Now - anyDate).Days; If you substract one DateTime object (NOT string) from another DateTime object you get a TimeSpan object. TimeSpan has the property Days which appears to be what you want.


      Upcoming events: * Glasgow: Geek Dinner (5th March) * Edinburgh: Web Security Conference Day for Windows Developers (12th April) My: Website | Blog | Photos

      A 1 Reply Last reply
      0
      • C Colin Angus Mackay

        days = (DateTime.Now - anyDate).Days; If you substract one DateTime object (NOT string) from another DateTime object you get a TimeSpan object. TimeSpan has the property Days which appears to be what you want.


        Upcoming events: * Glasgow: Geek Dinner (5th March) * Edinburgh: Web Security Conference Day for Windows Developers (12th April) My: Website | Blog | Photos

        A Offline
        A Offline
        Ahmed El Badry
        wrote on last edited by
        #3

        Please give an example of it thnx:rose:

        Ahmed El-Badry

        C 1 Reply Last reply
        0
        • A Ahmed El Badry

          Please give an example of it thnx:rose:

          Ahmed El-Badry

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          Ahmed El-Badry wrote:

          Please give an example of it

          I did! Read the first line, which is a sample of code[^]


          Upcoming events: * Glasgow: Geek Dinner (5th March) * Edinburgh: Web Security Conference Day for Windows Developers (12th April) My: Website | Blog | Photos

          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