Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 15-12-2009
Member
 
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.
Reply With Quote
  #2  
Old 15-12-2009
Member
 
Join Date: May 2008
Posts: 2,293
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.
Reply With Quote
  #3  
Old 15-12-2009
Member
 
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.
Reply With Quote
  #4  
Old 15-12-2009
Member
 
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]])
Reply With Quote
  #5  
Old 15-12-2009
Member
 
Join Date: May 2008
Posts: 2,383
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.
Reply With Quote
  #6  
Old 15-12-2009
Member
 
Join Date: May 2008
Posts: 2,008
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 02:47 PM.