$! DATE_TIME.COM - Display the time in a human-readable format. $! $! Author: Peter Johansson (peter@cs.umbc.edu) $! $! This file is intended for informational purposes only - Execute it at $! your own risk. All code Copyright (C) 1993 by Peter Johansson. $! $! Non-commercial use unrestricted so long as all attributions remain $! intact. That is, if you use any part or parts of this code, I want $! credit for my work. $! $! --- begin origonal file --- $! $! This command file displays the date, and time in am/pm format $! $ time = p1 $ if time .eqs. "" then time = f$time() $! $ day = f$cvtime(time,,"weekday") $ year = f$cvtime(time,,"year") $ mon = f$int(f$cvtime(time,,"month")) $ date = f$int(f$cvtime(time,,"day")) $ hr = f$int(f$cvtime(time,,"hour")) $ min = f$cvtime(time,,"minute") $ sec = f$cvtime(time,,"second") $! $ month_list = "/January/February/March/April/May/June/July/August/September/October/November/December" $ month = f$element(mon, "/", month_list) $ if (month .eqs. "/") .or. (month .eqs. "") then month = "ERROR!" $! $ tag1 = "th" $ if date .eq. 1 .or. date .eq. 21 then tag1 = "st" $ if date .eq. 2 .or. date .eq. 22 then tag1 = "nd" $ if date .eq. 3 .or. date .eq. 23 then tag1 = "rd" $ date = f$str(date) $! $ if hr .ge. 12 then goto pm $ am: $ if hr .eq. 0 then hr = 12 $ tag2 = "am" $ goto time $ pm: $ if hr .ne. 12 then hr = hr - 12 $ tag2 = "pm" $ time: $ hr = f$str(hr) $! $ write sys$output day+", "+month+" "+date+tag1+" "+year+", "+hr+":"+min+":"+sec+" "+tag2+"." $! $ exit