Results 1 to 4 of 4

Thread: find period in days / hours excluding weekdays between two days?

  1. #1
    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?

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    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

  3. #3
    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.

  4. #4
    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

Similar Threads

  1. How to calculate pay period between interval of 15 days
    By Bala!aditya in forum MS Office Support
    Replies: 2
    Last Post: 28-01-2012, 03:43 PM
  2. What is the formula for Excel to add days excluding holidays
    By Krupanath in forum MS Office Support
    Replies: 2
    Last Post: 24-01-2012, 02:08 PM
  3. Windows Vista Trial Period Extension for 120 Days
    By FaMe FacToR in forum Tips & Tweaks
    Replies: 2
    Last Post: 17-05-2009, 07:24 PM
  4. Replies: 0
    Last Post: 06-11-2008, 06:10 PM
  5. Duration shown in days(need) to display hours
    By The Man in forum Microsoft Project
    Replies: 0
    Last Post: 23-09-2008, 05:26 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,711,639,880.89808 seconds with 17 queries