Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9004361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:52:46+00:00 2026-06-16T00:52:46+00:00

Can we get the two date values difference using VBScript in Day-Hour-Minutes format?

  • 0

Can we get the two date values difference using VBScript in Day-Hour-Minutes format?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:52:47+00:00Added an answer on June 16, 2026 at 12:52 am

    here is a HH::MM:SS example changing it to DD::HH::MM should be easy

    ASP FAQ – Date time routines manipulation

    <% 
        Function TimeSpan(dt1, dt2) 
            If (isDate(dt1) And IsDate(dt2)) = false Then 
                TimeSpan = "00:00:00" 
                Exit Function 
            End If 
    
            seconds = Abs(DateDiff("S", dt1, dt2)) 
            minutes = seconds \ 60 
            hours = minutes \ 60 
            minutes = minutes mod 60 
            seconds = seconds mod 60 
    
            if len(hours) = 1 then hours = "0" & hours 
    
            TimeSpan = hours & ":" & _ 
                RIGHT("00" & minutes, 2) & ":" & _ 
                RIGHT("00" & seconds, 2) 
        End Function 
    
        d1 = "2002-03-27 9:20:25 AM" 
        d2 = "2002-03-27 9:20:45 AM" 
    
        Response.Write TimeSpan(d1, d2) 
    %>
    

    something like:( im not sure, I don’t know vbscript)

    <% 
        Function TimeSpan(dt1, dt2) 
            If (isDate(dt1) And IsDate(dt2)) = false Then 
                TimeSpan = "00:00:00" 
                Exit Function 
            End If 
    
            seconds = Abs(DateDiff("S", dt1, dt2)) 
            minutes = seconds \ 60 
            hours = minutes \ 60 
            days  = hours \ 24
            minutes = minutes mod 60 
            seconds = seconds mod 60 
            hours   = hours   mod 24 
    
            if len(hours) = 1 then hours = "0" & hours 
    
            TimeSpan = days& ":" & _ 
                RIGHT("00" & hours , 2) & ":" & _ 
                RIGHT("00" & minutes, 2) 
        End Function 
    
        d1 = "2002-03-27 9:20:25 AM" 
        d2 = "2002-03-27 9:20:45 AM" 
    
        Response.Write TimeSpan(d1, d2) 
    %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I get the difference between two times in a Batch file? Because
Possible Duplicate: Based on date, get todays and the next two days values from
I want to get two particular dates by using current date, let me explain
I have two csv file ( ) I can get it to print out
How I can get name of parent activity in child activity. I have two
I have two questions. How can I get the spinner in the figure below
I'm trying to compare two datetimes but I can't get it to work. public
In my GWT project, I'm trying to get it so two DialogBoxes can pass
Can I capture the following two routes in a single line? GET /game controllers.Main.app.gamelist
If I want to get to a value in vector I can use two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.