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 19-06-2009
Member
 
Join Date: May 2008
Posts: 97
find period in days / hours excluding weekdays between two days?

Hi,

Is there any way of calculating the total period between the two dates in days or hrs excluding the weekdays?
Reply With Quote
  #2  
Old 19-06-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: find period in days / hours excluding weekdays between two days?

USE DateDiff Function

DateDiff(DateInterval.Day, dtmStart, dtmEnd)

Code:
Public Overloads Function DateDiff( _
   ByVal Interval As String, _
   ByVal Date1 As Object, _
   ByVal Date2 As Object, _
   Optional ByVal DayOfWeek As FirstDayOfWeek = FirstDayOfWeek.Sunday, _
   Optional ByVal WeekOfYear As FirstWeekOfYear = FirstWeekOfYear.Jan1 _
) As Long

You need to assign values to dtmStart(start date) & dtmEnd(end date).

http://msdn.microsoft.com/en-us/libr...6f(vs.71).aspx
Reply With Quote
  #3  
Old 19-06-2009
Member
 
Join Date: Nov 2008
Posts: 85
Re: find period in days / hours excluding weekdays between two days?

I have the same question for python language?

Please help me.
Reply With Quote
  #4  
Old 19-06-2009
Member
 
Join Date: Nov 2008
Posts: 69
Re: find period in days / hours excluding weekdays between two days?

Python(Script)
This will return the number of days between two dates. In the script I'm using ZopeTime but I can be changed if necessary. Most of the clues to this puzzle were gathered from the Zope List.
Source
from DateTime import DateTime
date1 = DateTime('2001/10/06 14:00:00')
date2 = context.ZopeTime()
return str(date1 - date2)[:2]
Add a script(Python) called time_lapse and paste the source from above.
The returned number of days can then be referenced with the <dtml-var time_lapse>
for details: http://www.zopelabs.com/cookbook/997725258
Reply With Quote
Reply

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



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "find period in days / hours excluding weekdays between two days?"
Thread Thread Starter Forum Replies Last Post
How to calculate pay period between interval of 15 days Bala!aditya MS Office Support 2 28-01-2012 03:43 PM
What is the formula for Excel to add days excluding holidays Krupanath MS Office Support 2 24-01-2012 02:08 PM
Windows Vista Trial Period Extension for 120 Days FaMe FacToR Tips & Tweaks 2 17-05-2009 07:24 PM
Rearm and Extend Free Usage (Activation Grace Period) Windows 7 to 120 Days Rebecca.j Tips & Tweaks 0 06-11-2008 06:10 PM
Duration shown in days(need) to display hours The Man Microsoft Project 0 23-09-2008 05:26 PM


All times are GMT +5.5. The time now is 03:26 PM.