Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: Re: How to get TZ difference?

by sgifford (Prior)
on Jun 28, 2003 at 17:55 UTC ( #269914=note: print w/replies, xml ) Need Help??


in reply to Re: Re: How to get TZ difference?
in thread How to get TZ difference?

This is a little shorter and more confusing.
@local=(localtime(time+$off_h*60*60)); @gmt=(gmtime(time+$off_h*60*60)); $diff=$gmt[2]-$local[2] + ($gmt[5] <=> $local[5] || $gmt[7] <=> $local[7])*24;

Replies are listed 'Best First'.
Re: Re: Re: Re: How to get TZ difference?
by dda (Friar) on Jul 06, 2003 at 06:38 UTC
    Hi,

    Thanks for your idea. But let me ask you what is $off_h here? And I found that correct result occurs when I subtract $gmt[2] from $local[2]:

    $diff=$local[2]-$gmt[2] + ($gmt[5] <=> $local[5] || $gmt[7] <=> $local[7])*24;

    --dda

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://269914]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2022-09-25 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (116 votes). Check out past polls.

    Notices?