in reply to Re^4: Display Specific Time on Any PC.
in thread Display Specific Time on Any PC.
prints the current time in Los Angeles.#!/usr/bin/perl -w use strict; use DateTime; my $dt = DateTime->from_epoch( epoch => time() )->set_time_zone('Ameri +ca/Los_Angeles'); print $dt->hms(':');
prints what time it was in Rome when I wrote this code. You need two pieces of data:#!/usr/bin/perl -w use strict; use DateTime; my $dt = DateTime->from_epoch( epoch => 1395697655 )->set_time_zone('E +urope/Rome'); print $dt->hms(':');
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|