*+”"''date format codes”codes"'' Alters the output using the specified date conversion codes which are prefaced with at % sign. <ref name=KerriskLocale>{{cite web |last=Kerrisk |first=Michael |date=Feb 2, 2025 |title=date(1) — Linux manual page |url=https://man7.org/linux/man-pages/man1/date.1.html |access-date=Mar 20, 2025 |website=man7.org |publisher=}}</ref> date +”Today"Today is day %j of the year %Y and it’s a %A”A"
Output: Today is day 078 of the year 2025 and it’s a Wednesday
*-d “"''datestring''”" or --date==''”datestring”"datestring"'' Displays the quoted date. Can be used with the + flag. Date strings consist of ''calendar date items'' which express day month and year, ''and time of day items'' which express hour:minute:second''.'' Either item group is optional and they may appear in either order.<ref>{{cite web |author=<!-- not stated --> |title=Date input formats |url= https://www.gnu.org/software/coreutils/manual/html_node/Date-input-formats.htmlwebsite=gnu.org |publisher=gnu.org |access-date=Mar 20, 2025}} </ref> Times and dates can be adjusted using ''relative item'' expressions such as + or - ''time unit'' as well as keywords such as ''now, yesterday, tomorrow, previous, next, first and last.<ref>{{cite web |author=<!-- not stated --> |title=Relative items in date strings |url= https://www.gnu.org/software/coreutils/manual/html_node/Relative-items-in-date-strings.html|website=gnu.org |publisher=gnu.org |access-date=Mar 20, 2025}}</ref>
''Examples:''
Line 21:
*-r or --reference=''filename ''- outputs the last modification time of the file
*-s or --set=”"''datestring”datestring"'' sets the current date and time to the value of ''datestring.'' Requires an account with admin privilege.<ref>{{cite book|last1=Glass |first1=Graham | last2=King| first2=Ables|date=2006 |title=Linux for Programmers and Users |___location=Upper Saddle River, NJ |publisher=Pearson Prentice Hall|page=44|isbn=978-0131-857483}} </ref>
*-u or --UTC displays [[Universal time|Greenwich Mean Time]]