[Info-vax] DCL Time Manipulation
Stafford Winters
stafford.winters2 at frontier.com
Wed Aug 17 15:07:51 EDT 2011
On 8/17/2011 10:41 AM, James J. O`Shea wrote:
> I'm trying to get the amount of time a user is logged in monthy, using ACCOUNTNG. How can I get the sum of times in DCL?
>
> The following sum is less than 24, so it returns the correct value.
> T1="0 06:00:00.00"
> T2="0 10:00:00.00
> TOTAL=F$CVTIME(T1+"+"+T2,,"TIME")"
> $ sho symbol total
> TOTAL = "16:00:00.00"
>
> The total of the below is 25 hours but it reports only 1 hour. Do you know how to return the correct value?
> T1="0 06:00:00.00"
> T2="0 19:00:00.00"
> TOTAL=F$CVTIME(T1+"+"+T2,,"TIME")"
> $sho symbol total
> TOTAL = "01:00:00.00"
I saw your previous post and had intended on replying, but just hadn't
gotten to it. F$CVTIME() is not intended to do what you are trying to
accomplish.
I'd suggest you look into using it to extract various components of
time. With the hour components, you could simply convert them to
integers with F$INTEGER(hour_t1) and F$INTEGER(hour_t2) and then add
those for a total of the hours.
Tad
More information about the Info-vax
mailing list