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

Timezone PST to IST

by jai_dgl (Beadle)
on Jul 02, 2007 at 05:00 UTC ( #624375=perlquestion: print w/ replies, xml ) Need Help??
jai_dgl has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I have all the information (sec,min,hr,dd,mm,yyyy) of the Time zone PST and I want to convert PST time zone information to IST. Please help me out.

Comment on Timezone PST to IST
Replies are listed 'Best First'.
Re: Timezone PST to IST
by santhi (Monk) on Jul 02, 2007 at 10:23 UTC
    You can use the code as below:
    use DateTime; my $source = DateTime->new(year => 2007, month => 7, day => 2, hour => 13, minute => 55, time_zone => 'America/Los_Angeles'); my $result = $source->clone() ->set_time_zone('Asia/Calcutta'); print $source->strftime("%F %r %Z"), "will become ", $result->strftime("%F %r %Z");
    Output: 2007-07-02 01:55:00 PM PDT will become 2007-07-03 02:25:00 AM IST
Re: Timezone PST to IST
by Anonymous Monk on Jul 02, 2007 at 05:39 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://624375]
Approved by jesuashok
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2015-07-28 13:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls