Results 1 to 6 of 6

Thread: VBScript DateDiff Function

  1. #1
    Join Date
    Apr 2009
    Posts
    87

    VBScript DateDiff Function

    I am using VBScript for my project and i would like to use VBScript DateDiff function in my code. So it can show amount of time in date, months and also gives the difference between two date-time values. Any help will be extremely appreciated.

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: VBScript DateDiff Function

    The VBScript DateDiff function is used to determine the amount of time (months, weeks, days, hours, etc.) between two date-time values.This function displays a calendar page of the chosen month and year. In Windows PowerShell you can perform this same kind of date arithmetic using the New-TimeSpan Cmdlet.

  3. #3
    Join Date
    Jan 2009
    Posts
    199

    Re: VBScript DateDiff Function

    In classic ASP, vbscript DateDiff function of date time functions series can also be used to get the number of specified type of time intervals between the two given time values. Returns the number of intervals between two dates. PHP, unfortunately, had no function to perform the same task.

  4. #4
    Join Date
    Dec 2008
    Posts
    177

    Re: VBScript DateDiff Function

    VBScript DatePart Function : the DatePart function to extract the various parts of the original date (no need for the minutes and seconds). The DateAdd function returns a date, it's very useful, allowing you to find out the time intervals between customer dates.

    Code:
    DatePart(interval, date[, firstdayofweek[, firstweekofyear]])

  5. #5
    Join Date
    May 2008
    Posts
    2,389

    Re: VBScript DateDiff Function

    Vbscript DateDiff function returns the number of minutes, seconds, or hours between the specified time values based on time interval. Example : $b = New-TimeSpan $(Get-Date) $(Get-Date -month 12 -day 31 -year 2006 -hour 23 -minute 30)You can use the DateDiff function to find out the specified time intervals between the given two dates. Classic ASP VbScript DateDiff function with Time intervals provides the functionality to get the difference between 2 specified time values.

  6. #6
    Join Date
    May 2008
    Posts
    2,012

    Re: VBScript DateDiff Function

    The following example uses the DateDiff function to display the number of days between a given date and today:
    Code:
    Function DifDate(Date)
      DifDate = "Days from today: " & DateDiff("a", Now, theDate)
    End Function

Similar Threads

  1. c# function equivalent to gettime function in javascript
    By Omaar in forum Software Development
    Replies: 4
    Last Post: 10-03-2010, 10:44 PM
  2. How does abstract function differs from virtual function?
    By Maddox G in forum Software Development
    Replies: 5
    Last Post: 29-01-2010, 11:32 AM
  3. datediff query mssql select
    By John mitchell in forum Software Development
    Replies: 3
    Last Post: 09-06-2009, 10:43 PM
  4. Function keys don't function under windows XP
    By GunFighter in forum Hardware Peripherals
    Replies: 3
    Last Post: 08-04-2009, 11:07 PM
  5. How do I use DATEDIFF to count only working days?
    By HAYES in forum Microsoft Project
    Replies: 2
    Last Post: 24-06-2008, 04:46 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,280,041.96035 seconds with 17 queries