commands/DATE                                                   commands/DATE

   NAME
	DATE - To display or set the system date and/or time.

   FORMAT
	DATE [<day>] [<date>] [<time>] [SERVER <name>] [PORT <n>] [OFFSET <n>]
	[LFORMAT <string>] [TO|VER <filename>]

   TEMPLATE
	DAY,DATE,TIME,SERVER/K,PORT/K/N,OFFSET/K/N,LFORMAT/K,TO=VER/K

   PATH
	C:DATE

   FUNCTION
	DATE with no argument displays the currently set system date and time,
	including the day of the week. Time is displayed using a 24-hour clock.

	DATE <date> sets just the date. The date can be specified either in
	the current default locale format or in the AmigaDOS format DD-MMM-YY
	(day-month-year). If the AmigaDOS format is used, the hyphens
	between the arguments are required. A leading zero in the date
	is not necessary. The first 3 letters of the month (in the current
	locale language) must be used, as well as the last two digits of
	the year.

	The date can also be reset by specifying a day name, thus setting
	the date forward to that day of the week. You can also use tomorrow
	or yesterday as the <day> argument.

	DATE <time> sets the time. The time can be specified either in the
	current default locale format or in the AmigaDOS format HH:MM:SS
	(hours:minutes:seconds). Seconds are optional.

	The SERVER option is used to retrieve the current date and time from a
	remote server over a TCP/IP connection using the Network Time Protocol
	(NTP). A list of NTP time servers and some good background information
	can be found at http://www.eecis.udel.edu/~mills/ntp/servers.html.

	By using PORT you can specify a port number different to the
	default 123.

	The OFFSET argument allows to set the offset in minutes of your
	location with respect to Greenwich Mean Time (GMT). If OFFSET is
	not specified, the locale offset will be used.

	The LFORMAT option modifies the output of DATE using one or more
	substitution operators. The available substitution operators are:

	%a - abbreviated weekday name
	%A - weekday name
	%b - abbreviated month name
	%B - month name
	%c - same as "%a %b %d %H:%M:%S %Y"
	%d - day number with leading 0s
	%D - same as "%m/%d/%y"
	%e - day number with leading spaces
	%h - abbreviated month name
	%H - hour using 24-hour style with leading 0s
	%I - hour using 12-hour style with leading 0s
	%j - julian date
	%m - month number with leading 0s
	%M - the number of minutes with leading 0s
	%n - insert a linefeed
	%p - AM or PM strings
	%q - hour using 24-hour style
	%Q - hour using 12-hour style
	%r - same as "%I:%M:%S %p"
	%R - same as "%H:%M"
	%S - number of seconds with leadings 0s
	%t - insert a tab character
	%T - same as "%H:%M:%S"
	%U - week number, taking Sunday as first day of week
	%w - weekday number
	%W - week number, taking Monday as first day of week
	%x - same as "%m/%d/%y"
	%X - same as "%H:%M:%S"
	%y - year using two digits with leading 0s
	%Y - year using four digits with leading 0s

	If you specify the TO or VER option, followed by a filename, the output
	of the DATE command is sent to that file, overwriting any existing
	contents.

	If your Amiga does not have a battery backed-up hardware clock and you
	do not set the date, the system, upon booting, will set the date to the
	date of the most recently created file on the boot disk.

	NOTE: Adjustments made with DATE only change the software clock. They
	will not survive past power-down. To set the battery backed-up hardware
	clock from the Shell, you must set the date and use SETCLOCK SAVE.

   RESULTS

	If DATE succeeded in setting the system date and/or time the primary return
	code (RC) will be set to 0.
	A return code of 5 or 20 indicates that DATE failed partially or completely.
	If an error occurred when trying to get time from a remote server the
	primary return code will be set to 21.
	In this case the secondary return code (RESULT2) may contain a tcp stack
	socket/resolver error number and the corresponding error message will be
	displayed.

   EXAMPLES
	    1> DATE

	displays the current date and time.

	    1> DATE LFORMAT "Today it&#039;s %A, %m/%d/%Y, %T"

	displays a message like "Today it&#039;s Monday, 02/17/2003, 22:30:56".

	    1> DATE 1-jan-04

	sets the date to January 1st, 2004 (the earliest date you can set is
	January 1, 1978). The time is not reset.

	    1> DATE tomorrow

	resets the date to one day ahead.

	    1> DATE TO Fred

	sends the current date to the file Fred.

	    1> DATE 23:00

	sets the current time to 11:00 p.m.

	    1> DATE SERVER foo.bar.com OFFSET -480

	gets the current date and time from the foo.bar.com NTP server for a
	location based on the Pacific Standard Time used in the United States.

   SEE ALSO
	SETCLOCK

Add a code snippet to your website: www.paste.org