in reply to Atomic Time and Date
#!/usr/bin/perl -w use strict; use Net::Time qw(inet_time); my $date_and_time = inet_time('cesium.clock.org', 'tcp'); my ($sec, $min, $hour, $day, $month, $year) = (localtime($date_and_time))[0..5]; my $new_date = sprintf "%02d/%02d/%04d", $month + 1, $day, $year + 190 +0; my $new_time = sprintf "%02d:%02d:%02d", $hour, $min, $sec; system('time', $new_time) or die "Couldn't set time: $!"; system('date', $new_date) or die "Couldn't set date: $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Atomic Time and Date
by providencia (Pilgrim) on Jun 05, 2000 at 19:48 UTC | |
by mdillon (Priest) on Jun 05, 2000 at 19:52 UTC |