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. DateDiff for days and time

DateDiff for days and time

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
3 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.
  • S Offline
    S Offline
    steve_rm
    wrote on last edited by
    #1

    Hello, I want to be able to calculate how long an event took. The user will enter the data using a datetimepicker for the start date, and when the event ends enter the stop date in a datetimepicker. Does the datetimepicker capture the time when the date was set in one of these controls? I have been using the dateDiff to calculate. However, it only gives me the difference between to dates but not the actual time it was set. For example 26/2/2007 14:00 started finisted at 28/2/2007 10:00 The total time would be 1 Day 4 hours (working 9 to 5pm) Can anyone have any good ideas on how to calculate this, Many thanks, Steve

    S 1 Reply Last reply
    0
    • S steve_rm

      Hello, I want to be able to calculate how long an event took. The user will enter the data using a datetimepicker for the start date, and when the event ends enter the stop date in a datetimepicker. Does the datetimepicker capture the time when the date was set in one of these controls? I have been using the dateDiff to calculate. However, it only gives me the difference between to dates but not the actual time it was set. For example 26/2/2007 14:00 started finisted at 28/2/2007 10:00 The total time would be 1 Day 4 hours (working 9 to 5pm) Can anyone have any good ideas on how to calculate this, Many thanks, Steve

      S Offline
      S Offline
      Sachin Gokhale
      wrote on last edited by
      #2

      Try using the 'DATE DIFFERNECE' function ..... DDiff...

      S 1 Reply Last reply
      0
      • S Sachin Gokhale

        Try using the 'DATE DIFFERNECE' function ..... DDiff...

        S Offline
        S Offline
        steve_rm
        wrote on last edited by
        #3

        Hello, That was the function that I was using. But I was having trouble calculating the hours that elapsed. Thanks for any suggestions, Steve

        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