How long time till a Weekday or a Date

joepimms403

New Member
I want to find out how long time there is till a specific \[code\]Weekday\[/code\] from \[code\]Now\[/code\].I have searched everywhere, but can't really find anything.I THINK I have to use the \[code\]DateDiff\[/code\]-function together with the \[code\]WeekDay\[/code\]-function somehow.The scenario is:I have variable \[code\]varWeekDay\[/code\] with the day of the week, ex: 1 / 2 / 3 / 4 / 5 / 6 / 7And another variable \[code\]varStartTime\[/code\] with a time of the day: hh:mmAnd the last variable \[code\]varStopTime\[/code\] also with a time of the day: hh:mm\[code\]if varWeekday = Weekday(now, 2) and varStartTime < formatdatetime(now, 4) then .... Write how long time till start in hours / minuteselseif varWeekday = Weekday(now, 2) and varStartTime >= formatdatetime(now, 4) and varStopTime < formatdatetime(now, 4) then response.write("Already started!")else .... Write how long time till start in days / hours / minutesend if\[/code\]"How long time" could be like: "2 days, 3 hours and 27 minutes from now"The same output should be generated from a specific datetime. Ex: 06/08/2012 23:55 is "1 day and 13 minutes from now"I really hope you guys can help! :)
 
Back
Top