Some ways to use Linux date-d

Source: Internet
Author: User
Tags locale month name

The format output type character in the date command means such as the following:
A%%a of the current locale (for example: Day, representing Sunday)%a the full name of the current locale (for example: Sunday)%b The month name of the current locale (for example: one, representing January)%b the full name of the current locale (e.g. January)% C Date and time of the current locale (e.g. Thursday, March 3, 2005 23:05:25)%c century; for example,%Y. Typically omit the two digits of the current year (such as:%d), the date of the month (for example:%m/%d/%y%e), the date of the month, equal to the date of the month, add a space, equal to the%_d%f full date format, equivalent to%y-%m-%d%giso-8601 The last two digits of the format year (see%G)%giso-8601 format year (see%V). Generally only combined with%V%h equals%b%h hours (00-23)%i hours (00-12)%j year-on-day (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 newline%n nanoseconds (000000000-999999999)%p "Morning" or "afternoon" under current locale. When unknown, the output is empty%p is similar to%p, but the output lowercase letter%r The 12 hour clock time under the current locale (for example: 11:11:04 pm)%r24 hours time and minutes, equivalent to%h:%m%s since 1970-01-01 00:00:00 UTC time The number of seconds%s seconds (00-60)%t output tab tab%t time, which is equal to%h:%m:%s%u week. 1 represents the week of Monday%u year. The week of the first day of the Year (00-53) in Sunday, under the%viso-8601 format specification, with Monday being the first day of the Week (01-53)%w the day of the Week (0-6), and 0 representing Monday%w the first week of the year, with Monday being the day of the Week (00-53) X date descriptive narrative under current locale (e.g. 12/31/99)%x time descriptive narrative under current locale (e.g. 23:13:48)%y year last two digits (00-99)%y year%z +HHMM digital time zone (for example, -0400)%:z +hh: MM Digital time zone (for example, -04:00)%::z +hh:mm:ss Digital time zone (for example,-04:00:00)%:::z Digital time zone with the necessary precision (for example,-04. +05:30)%z The time zone abbreviations sorted alphabetically (for example. EDT)



Date-d often use demo examples and instructions:

date-d ' 2 days ago '//Show 2 day time date-d ' second ago '//show 60 seconds once date-d ' 3 months 1 day '//show March 1 days after date-d ' Dec ' + %j//show December 25 on which day of the year date-d ' 1970-01-01 00:00:30 +0000 ' +%s   //The number of seconds since UTC time 1970-01-01 00:00:00

Some ways to use Linux date-d

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.