Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Convert unix timestamp

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Convert unix timestamp to normal date format

Date-d '1970-01-01 UTC xxxxxxxxxx seconds' + "% F% T"

Displays the time of the current unix timestamp

Date +% s

For example:

# date

Thu Sep 20 18:02:28 CST 2007

# date

Thu Sep 20 18:02:40 CST 2007

# date +% s

1190282563

# date-d '1970-01-01 UTC 1190282563 seconds' + "% F% T"

2007-09-20 18:02:43

Today's 2.14, it's exactly 1234567890.

Date-d @ 1234567890

Perl-e'print scalar localtime (1234567890), "\ n";'

Multiple-v parameters can be specified at the same time, calculated in the specified order

Date-Vmur1m-V1d the first day of last month

Date-V1d-v-1D the last day of last month. The first day of this month minus one day is the last day of last month.

Date-vain 1m-v1d-vmur1d the last day of the month. The first day of next month minus one day is the last day of this month.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report