简体   繁体   中英

How to takeaway seconds to time.strftime in python 2.7?

I want to use this time format that I have:

time.strftime("%Y_%m_%d_%H_%M_%S")

So, if I were to print it, it would look like this:

2015_11_20_15_28_03

And I was wondering how I could takeaway seconds from it. I've only had luck with finding how to add hours and minutes, which don't work for seconds.

如果不希望,只需排除%S ,它代表秒。

time.strftime("%Y_%m_%d_%H_%M")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM