1. The function description shows or modifies the system time and date. Only the superuser can set the time with the date command. Generally, the user can only display the time with the date command. The syntax of the date command is as follows: date [options] Display time format (starting with + followed by time format) The options for the Date command and their descriptions are as follows. — -s --set: Set the system time. — -d --date: Displays the date of the description. The time display format is shown in Table 4.3. Table 4.3 Time Display Format
Format means meaning %H shows hour, indicating range is 00~23 %I Display hour, indicating range is 01~12 %k Display hour, indicating range 0~23 %l Display hour , indicates that the range is 1~12 %M, the display time is 00~59 %S, the display format is 00~59 %p, the display is AM (AM) or PM (PM), %r Display time, the format is hh :mm:ss AM or PM, where hh stands for hour, mm stands for minute, ss stands for second %T display time, format is hh:mm:ss %x displays year and date, format is mm/dd/yyyy, here yyyy Represents the year %X display time format, which is equivalent to %H:%M:%S combination %a shows the day of the week %b or %B shows the month, %b is the abbreviation of the month, and %B is the full name of the month. Month, the format is from 01 to 12% Z. The time zone %d shows the day of the month. %D displays the year and month in the format mm/dd/yy, where yy represents the last two digits of the year, %Y or %. y shows the year, %Y shows the full year, %y shows the last two digits of the year %c shows the date and time format, which is equivalent to “%a The combination of %d %b %Y %r %Z” Example (1) Display the time and date in the specified format. # date '+This date now is:%x, time is now:%X,thanks!'This date now is:07/15/2008, time is now:07:41:35 PM,thanks!(2)Modify system time. [root@mylinux /]# date -s 20080715 Tue Jul 15 00:00:00 CST 2008[root@mylinux /]# date -s 17:25 Tue Jul 15 17:25:00 CST 2008 can also put the above two Merge together. [root@mylinux /]# date -s "20080715 17:25"Tue Jul 15 17:25:00 CST 2008(3) shows the time two days ago. [root@mylinux /]# date '+%Y-%m-%d'2008-07-15[root@server108 /]# date -d "2 days ago" +%Y-%m-%d2008- 07-13
AWK Stands for ‘Aho, Weinberger, and Kernighan‘Awk is a scripting language which is use
CentOS modify IP address First turn off the firewall: service iptables stop# ifconfig eth0 192.168.1
When using a computer, it often interacts with some encrypted documents, such as Zip, Rar, and even
Use httpry to sniff HTTP traffic under Linux Tutorial Sometimes you want to sniff HTTP traffic for
Getting Started with Linux Commands: Other Important Commands Using Basic Tutorial
Linux environment programming - perror, exit,
Linux Crontab uses the basic tutorial
Linux often crashes, stuck, what should I do?
Monitor website logs under Linux command line
Desktop migration to Linux 4 questions do you know
Serial communication study notes under Linux operating system
Win10 preview version boot black screen how to repair
Win10 system QQ software installation tutorial
After Windows 7 is released: XP users wait and see
WinXP steps to create a computer lock shortcut
With the microblogging record Win7 login time
Drive life and drive wizard which is good