#!/usr/bin/perl -w # Created by Ben Okopnik on Sun Jul 29 21:49:17 UTC 2001 # Allows easy time changes that don't affect "/etc/adjtime" # # Note that the "Date::Manip" parser is clever enough for things like "2 days, # 6 hours, 18 minutes and 4 seconds ago"; this does not mean that you should # use it that way. :) On the other hand, you can't really hurt anything - and # you'll see (via the printed output) if your changes had any effect, so what # the heck. $|++; use Date::Manip; die "Usage: ", $0 =~ m{([^/]*)$}, " <[+-]n hours>\n" unless @ARGV; die "You're not root, are you?\n" unless (getpwuid($<))[2] == 0; $x = sprintf UnixDate(DateCalc("now", join " ", @ARGV), "%m/%d/%Y %X"); print `date -s "$x"`