Linux系統(tǒng)中date命令的使用實(shí)例

本篇內(nèi)容主要講解“Linux系統(tǒng)中date命令的使用實(shí)例”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強(qiáng)。下面就讓小編來(lái)帶大家學(xué)習(xí)“Linux系統(tǒng)中date命令的使用實(shí)例”吧!

在內(nèi)黃等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強(qiáng)發(fā)展的系統(tǒng)性、市場(chǎng)前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供成都網(wǎng)站制作、做網(wǎng)站 網(wǎng)站設(shè)計(jì)制作專業(yè)公司,公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),品牌網(wǎng)站設(shè)計(jì),全網(wǎng)營(yíng)銷(xiāo)推廣,成都外貿(mào)網(wǎng)站建設(shè),內(nèi)黃網(wǎng)站建設(shè)費(fèi)用合理。

date用法1:

       格式:date [OPTION]... [+FORMAT]

       FORMAT controls the output.  Interpreted sequences are:


       %%     a literal %

       %a     locale's abbreviated weekday name (e.g., Sun)      

       %A     locale's full weekday name (e.g., Sunday)

       %b     locale's abbreviated month name (e.g., Jan)

       %B     locale's full month name (e.g., January)

       %c     locale's date and time (e.g., Thu Mar  3 23:05:25 2005)

       %C     century; like %Y, except omit last two digits (e.g., 20)

       %d     day of month (e.g., 01)

       %D     date; same as %m/%d/%y

       %e     day of month, space padded; same as %_d

       %F     full date; same as %Y-%m-%d

       %g     last two digits of year of ISO week number (see %G)

       %G     year of ISO week number (see %V); normally useful only with %V

       %h     same as %b


       %H     hour (00..23)

       %I     hour (01..12)

       %j     day of year (001..366)

       %k     hour, space padded ( 0..23); same as %_H


       %l     hour, space padded ( 1..12); same as %_I


       %m     month (01..12)


       %M     minute (00..59)


       %n     a newline


       %N     nanoseconds (000000000..999999999)


       %p     locale's equivalent of either AM or PM; blank if not known


       %P     like %p, but lower case


       %r     locale's 12-hour clock time (e.g., 11:11:04 PM)


       %R     24-hour hour and minute; same as %H:%M


       %s     seconds since 1970-01-01 00:00:00 UTC


       %S     second (00..60)


       %t     a tab


       %T     time; same as %H:%M:%S


       %u     day of week (1..7); 1 is Monday


       %U     week number of year, with Sunday as first day of week (00..53)


       %V     ISO week number, with Monday as first day of week (01..53)


       %w     day of week (0..6); 0 is Sunday

       %W     week number of year, with Monday as first day of week (00..53)


       %x     locale's date representation (e.g., 12/31/99)


       %X     locale's time representation (e.g., 23:13:48)


       %y     last two digits of year (00..99)


       %Y     year


       %z     +hhmm numeric time zone (e.g., -0400)


       %:z    +hh:mm numeric time zone (e.g., -04:00)


       %::z   +hh:mm:ss numeric time zone (e.g., -04:00:00)


       %:::z  numeric time zone with : to necessary precision (e.g., -04, +05:30)


       %Z     alphabetic time zone abbreviation (e.g., EDT)


       By default, date pads numeric fields with zeroes.  The following optional flags may follow `%':


       -      (hyphen) do not pad the field


       _      (underscore) pad with spaces


       0      (zero) pad with zeros


       ^      use upper case if possible


       #      use opposite case if possible

例如:

1.年月日

代碼如下:


$ date +%Y%m%d
20150107


2.年月日,年只保留后兩位

代碼如下:


~$ date +%y%m%d
150107


3.小時(shí)分鐘秒

代碼如下:


~$ date +%H%M%S
233045


4.年月日時(shí)分秒

代碼如下:


~$ date +%Y%m%d%H%M%S
20150107233145

到此,相信大家對(duì)“Linux系統(tǒng)中date命令的使用實(shí)例”有了更深的了解,不妨來(lái)實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

標(biāo)題名稱:Linux系統(tǒng)中date命令的使用實(shí)例
文章位置:http://muchs.cn/article28/isjejp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供標(biāo)簽優(yōu)化、手機(jī)網(wǎng)站建設(shè)、搜索引擎優(yōu)化、移動(dòng)網(wǎng)站建設(shè)、網(wǎng)站建設(shè)、靜態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)