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. Web Development
  3. ASP.NET
  4. Calculate Time Duration

Calculate Time Duration

Scheduled Pinned Locked Moved ASP.NET
3 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.
  • K Offline
    K Offline
    Kasi Viswanathan
    wrote on last edited by
    #1

    I want to enter out time of(02:42:15) with in time of(02:43:20)and see the duration of (00:01:05).Can any one send the code... It's Urgent. Thanks in advance:)

    I A 2 Replies Last reply
    0
    • K Kasi Viswanathan

      I want to enter out time of(02:42:15) with in time of(02:43:20)and see the duration of (00:01:05).Can any one send the code... It's Urgent. Thanks in advance:)

      I Offline
      I Offline
      Imran Khan Pathan
      wrote on last edited by
      #2

      TimeSpan Diff = TimeSpan.Parse("02:43:15") - TimeSpan.Parse("02:42:20"); Best Regard Pathan

      ---------------------------------------------------

      1 Reply Last reply
      0
      • K Kasi Viswanathan

        I want to enter out time of(02:42:15) with in time of(02:43:20)and see the duration of (00:01:05).Can any one send the code... It's Urgent. Thanks in advance:)

        A Offline
        A Offline
        Abhi
        wrote on last edited by
        #3

        Kasi Viswanathan wrote:

        out time of(02:42:15) with in time of(02:43:20)

        Try this : TimeSpan T1=new TimeSpan(System.DateTime.Now.Day,System.DateTime.Now.Hour,System.DateTime.Now.Minute,System.DateTime.Now.Second,System.DateTime.Now.Millisecond); TimeSpan T2=new TimeSpan(System.DateTime.Now.Day,System.DateTime.Now.Hour,System.DateTime.Now.Minute,System.DateTime.Now.Second,System.DateTime.Now.Millisecond); string ans = T2.Subtract(T1).ToString(); Hope this will help you !!

        Regards, Abhi

        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