Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!ames!ucbcad!ucbvax!VB.CC.CMU.EDU!R021JM9W From: R021JM9W@VB.CC.CMU.EDU (Jim Murawski) Newsgroups: comp.os.vms Subject: Changing from daylight time to standard time Message-ID: <8710241907.AA29503@ucbvax.Berkeley.EDU> Date: Fri, 23-Oct-87 17:05:34 EST Article-I.D.: ucbvax.8710241907.AA29503 Posted: Fri Oct 23 17:05:34 1987 Date-Received: Mon, 26-Oct-87 03:16:08 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 80 In most of North America, standard time starts this Sunday (October 25th) at 2:00. I have whipped up a command procedure (that'll run in batch) to automatically change the system time and notify the console that the time has changed. This same procedure can also be used when changing from standard time to daylight time. To submit it, type: $ Submit Timechange /Parameter=("DAYLIGHT/STANDARD") - /After="25-Oct-1987 02:00" /[Your favorite qualifiers] In case your Vax is down at 2:00 on Sunday, the batch job will still set your time back by 1 hour whenever the Vax comes back up, so the time will still be correct. Note that you may lose "a second or so" when changing the time via this procedure, but I'm sure most of you will find it acceptable. -Jim Murawski -Carnegie Mellon Computing Services -Pittsburgh, PA -R021JM9W@VB.CC.CMU.EDU (or CMCCVB.Bitnet) $! sys$user1:[r021jm9w]timechange.com;22 $! Last Edit Date = Fri Oct 23 16:50:12 1987 R021JM9W $! $! ** Revision History (Start) ** $! --------------------------------- $! Fri Oct 23 16:50:12 1987 R021JM9W : Initial version. $! --------------------------------- $! ** Revision History (Finish) ** $! $! TIMECHANGE - Change the time from Daylight to Standard or vice-versa, $! depending on the value of P1 (parameter 1 in batch). $! $ Save_Ver = F$Verify (1) $ On Error Then Goto ABORT $ On Control_Y Then Goto ABORT $ P1 = F$Edit (P1, "UPCASE,TRIM") $ If P1 .EQS. "STANDARD/DAYLIGHT" Then Goto START $ If P1 .EQS. "DAYLIGHT/STANDARD" Then Goto START $ Goto ABORT $START: $ Prev_Priv = F$Setprv ("OPER,LOG_IO") $ Cur_Timestamp = F$Time () $ Cur_Date = F$Cvtime (Cur_Timestamp, "ABSOLUTE", "DATE") $ Cur_Hour = F$Cvtime (Cur_Timestamp, , "HOUR") $ Cur_Minute = F$Cvtime (Cur_Timestamp, , "MINUTE") $ Cur_Second = F$Cvtime (Cur_Timestamp, , "SECOND") $ Cur_Hundredth = F$Cvtime (Cur_Timestamp, , "HUNDREDTH") $ If P1 .EQS. "STANDARD/DAYLIGHT" Then Goto ADD_HOUR $SUB_HOUR: $ New_Hour = F$String (F$Integer (Cur_Hour) - 1) $ Goto NEW_TIME $ADD_HOUR: $ New_Hour = F$String (F$Integer (Cur_Hour) + 1) $NEW_TIME: $ New_Timestamp = Cur_Date + " " + New_Hour + ":" + Cur_Minute + ":" - + Cur_Second + "." + Cur_Hundredth $ Set Time="''New_Timestamp'" $ Prev_Priv = F$Setprv (Prev_Priv) $! $! Notify the operator's console about the new time and send mail when OK $! $ Reply /Term=OPA0 /Bell - "Changed system time from ''Cur_Timestamp' to ''New_Timestamp'" $ Mail /Subject="Timechange OK!!" NL: "''F$Getjpi ("", "USERNAME")'" $ Save_Ver = F$Verify (Save_Ver) $ Exit $ABORT: $ Show Symbol $Status $ Save_Stat = $Status $! $! Send mail on error and notify the operator's console $! $ Mail /Subject="Timechange Had Errors!!" NL: "''F$Getjpi ("", "USERNAME")'" $ Reply /Term=OPA0 /Bell - "ERROR changing system time, please call ''F$Getjpi ("", "Username")'" $ Save_Ver = F$Verify (Save_Ver) $ Exit Save_Stat $! $! End of TIMECHANGE.COM