| Category: | Time Utilities |
| Author/Contact Info | providencia e-mail me |
| Description: | I was inspired by reptile's NIST Atomic Clock Time and wanted to see if I could make something simpler that would set the time and date as well. <var>I did this for a Win2K machine</var> |
|
#!/usr/bin/perl -w use strict; use Net::Time qw(inet_time); my %month_number = qw(Jan 01 Feb 02 Mar 03 Apr 04 May 05 Jun 06 Jul 07 Aug 08 Sep 09 Oct 10 Nov 11 Dec 12); my $date_and_time = inet_time('cesium.clock.org','tcp'); $date_and_time = localtime($date_and_time); my ($day_of_week,$month,$day_of_month,$time,$year) = split /\s+/,$date_and_time; $day_of_month = 0 . $day_of_month if ($day_of_month < 10); my $new_date = "$month_number{$month}/$day_of_month/$year"; system("time $time"); system("date $new_date"); |
|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Atomic Time and Date
by mdillon (Priest) on Jun 04, 2000 at 07:33 UTC | |
by providencia (Pilgrim) on Jun 05, 2000 at 19:48 UTC | |
by mdillon (Priest) on Jun 05, 2000 at 19:52 UTC |