Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
strftime( ) | Python Basics: Date and Time Mastery
Python Basics: Date and Time Mastery
course content

Зміст курсу

Python Basics: Date and Time Mastery

strftime( )

Now that you have created your dt object, you may have noticed that this is a proprietary Datetime object and, therefore, some methods may fail when applied to it. For that reason, datetime provides some functions to transform the datetime object into a string. This is particularly useful when you are in need of changing the formatting.

Завдання

  1. Create a Datetime object with the current date and time;
  2. Use the strftime() module to change the formatting in "%Y-%m-%d";
  3. Print the type of the dt variable.

Завдання

  1. Create a Datetime object with the current date and time;
  2. Use the strftime() module to change the formatting in "%Y-%m-%d";
  3. Print the type of the dt variable.

Mark tasks as Completed
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Now that you have created your dt object, you may have noticed that this is a proprietary Datetime object and, therefore, some methods may fail when applied to it. For that reason, datetime provides some functions to transform the datetime object into a string. This is particularly useful when you are in need of changing the formatting.

Завдання

  1. Create a Datetime object with the current date and time;
  2. Use the strftime() module to change the formatting in "%Y-%m-%d";
  3. Print the type of the dt variable.

Mark tasks as Completed
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 1. Розділ 3
AVAILABLE TO ULTIMATE ONLY
We're sorry to hear that something went wrong. What happened?
some-alt