![]() ![]() Let’s look at a couple of ways to set the time and date on a Linux machine. What it also does is it allows you to set the machine’s date and time. It’s a pretty cool command line tool that allows you to get your system’s date and time in various formats. We recently ran an article on the Linux “date” command. This guide will show you how to use the date command to set the date of your Linux machine and how to set the date by syncing it across the Internet. Try this command in your home folder: date -r. Note that this uses a - (hyphen) instead of a % sign, and it doesn’t require a + sign. To get the last modification time of a file, use the -r (reference) option. #: Use the opposite to the default case for the option, if possible (not all options respect this modifier).^: Uses uppercase, if possible (not all options respect this modifier).0: Provides leading zeroes for single digit values._: a single underscore adds leading spaces for single digit values.–: A single hyphen prevents zero padding on single digit values.For example, %-S would remove the leading zero for single-digit seconds values. These modifiers can be inserted between the % and the option letter of other options to modify their display. A lowercase p gives uppercase output, an uppercase P gives lowercase output. %P: Prints the am or pm indicator in lowercase.%p: Prints the AM or PM indicator in uppercase.%Z: Prints the alphabetic timezone name.%::z: Prints the time difference between your timezone and UTC, with a : between the hours, minutes and seconds.%:z: Prints the time difference between your timezone and UTC, with a : between the hours and minutes.%z: Prints the time difference between your timezone and UTC.%S: Prints the seconds, 01, 02, 03 … 59, with a leading zero if required.%s: Prints the number of seconds since 00:00:00, the start of the Unix Epoch. ![]() %M: prints the minute, 01, 02, 03 … 59, with a leading zero if required. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |