Linux Date common commands and timestamp conversions

Source: Internet
Author: User

The date command in Linux is primarily used for time calculations and log time format settings.

Date + "%T" shows the time T as a tab

[[Email protected] ~]# date + "%T" 14:00:08[[email protected] ~]# date + "%T" [[email protected] ~]#

Date + "%d"

[[Email protected] ~]# date + "%d" 08/04/16[[email protected] ~]# date + "%d" 04

Annual Income:

[[Email protected] ~]# date + "%y%m%d" 20160804[[email protected] ~]# date + "%y%m%d%m" 2016080402[[email protected] ~]# date + "%y%m%d%t" 2016080414:03:05

Conversion between timestamps and time:

1.1 Convert the current time to a timestamp:

[Email protected] salt]# date +%s1470817393

This article is from the "10943257" blog, please be sure to keep this source http://10953257.blog.51cto.com/10943257/1836586

Linux Date common commands and timestamp conversions

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.