Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by sgifford (Prior)
on Jun 28, 2003 at 17:55 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-03-28 10:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found