"Tom Phoenix" schreef:
> shadkeene:

>> The problem is that when I parse the valid time, I just have a number
>> like 0030, so if Perl's valid time is 2330, it would be an absolute
>> difference of 2300 according to the math but only an hour difference
>> in time.  Is there a function to subtract zulu times when they are
>> just strings of 4 numbers like I have in my script?
>
> There are many modules on CPAN for manipulating dates and times; you
> could convert the parsed time value into a standard time format, then
> subtract that.
>
> But it may be easiest for you if you break your four-digit string into
> hours and minutes and do the math that way. You may be able to use the
> % (modulus) operator to help:
>
>     my $diff = ($my_hour - $their_hour) % 24;

      my $diff = (24 + $their_hour - $my_hour) % 24;

Consider DateTime::TimeZone.

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to