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

Conteúdo do Curso

Python Basics: Date and Time Mastery

Operations with Dates

Now that you have understood what datetime objects are and how you can transform them, we can introduce the timedelta() function. timedelta() allows you to alter your dates by adding a delta to your dates (days, months, ecc..). We will also show how easy it is to find the difference between two dates.

Tarefa

  1. Import the datetime library with the timedelta module;
  2. Find the difference between two dates;
  3. Add 30 days to the date1 variable.

Tarefa

  1. Import the datetime library with the timedelta module;
  2. Find the difference between two dates;
  3. Add 30 days to the date1 variable.

Mark tasks as Completed
Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Now that you have understood what datetime objects are and how you can transform them, we can introduce the timedelta() function. timedelta() allows you to alter your dates by adding a delta to your dates (days, months, ecc..). We will also show how easy it is to find the difference between two dates.

Tarefa

  1. Import the datetime library with the timedelta module;
  2. Find the difference between two dates;
  3. Add 30 days to the date1 variable.

Mark tasks as Completed
Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 1. Capítulo 5
AVAILABLE TO ULTIMATE ONLY
We're sorry to hear that something went wrong. What happened?
some-alt