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

Shell implements the code to judge the year according to the date, month and week.

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "the code of Shell to judge the year according to the date, month and week". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "Shell implementation based on the date, month, week to judge the year of the code" it!

Three time variables are known:

Time1= "Fri Aug 23 11:35:21"

Time2= "Mon Sep 2 16:18:09"

Time3= "Tue Sep 3 16:06:33"

It is known that these three times can be determined to occur in 2011-2013, how to quickly determine which year?

Want to output:

Time1= "11:35:21 on 2013-8-23"

Time2= "16:18:09 on 2013-9-2"

Time3= "16:06:33 on 2013-9-3"

#! / bin/bashtime1= "Fri Aug 23 11:35:21" time2= "Mon Sep 2 16:18:09" time3= "Tue Sep 3 16:06:33" time4= "Sun Dec 2 16:06:34" for

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

Development

Wechat

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

12
Report