Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 1, 2026.

How to get local time using PERL?

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

pzqwpo

New Member
Impact
0
How to get local time using PERL while the server I am using is in a different time zone? For example, my local time is 9 am August 17th. But the server is in 9pm August 16th time zone. How do I write PERL code to get my local time?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
How to get local time using PERL while the server I am using is in a different time zone? For example, my local time is 9 am August 17th. But the server is in 9pm August 16th time zone. How do I write PERL code to get my local time?

Have you tried using:

Code:
localtime(time);
?

E.g:

Code:
#!/usr/local/bin/perl
@time = localtime(time);
print join('',@time);

-RageD
 
0
•••
Perl uses the TZ environmental variable to determine which timezone to use. Try adding the following to the top of the script:

Code:
$ENV{TZ}="UTC";

Set "UTC" to your timezone. Use timeanddate.com to work out the timezone for your location.
 
0
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back