第 7 步:让我们也重新格式化时间,以便我们知道是上午还是下午。
- 从上一个活动中找到这行代码: my_time · = · my_datetime 。 strftime( "%I:%M" ) ¬
- 在括号内,添加到字符串,使其看起来像这样: "%I:%M %p" 。
- 请注意,在M之后有一个空格。这个小添加会让我们知道它是上午还是下午。
- 点击运行然后点击控制台按钮查看新格式化的时间!
To navigate the page using the TAB key, first press ESC to exit the code editor.