课程: Python Essential Libraries
今天就学习课程吧!
今天就开通帐号,24,100 门业界名师课程任您挑!
Date formatting
- [Instructor] One of the more common operations performed on dates and times, is the process of formatting them for display to the user. Pendulum contains some great features for formatting strings beyond what we've seen so far from printing out date time objects. Let's go ahead and open up the formatting_start file. And you can see I've imported Pendulum. And just for a refresher, let's take a look at what the output looks like when we just print a date time out without any special formatting options. So I'm going to go ahead and run this in Visual Studio Code. And again, if you don't have Code, you can just run it in the terminal. And you can see in the output that this really isn't the most user friendly format. I mean it's just one big long string with a T in the middle and not entirely obvious where all the different components are. But there are some other really useful options available. So let's try a few of the…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。