Contenido del Curso
Organizing Date and Time Data for Analysis and Applications
Organizing Date and Time Data for Analysis and Applications
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.
Tarea
Swipe to show code editor
- Create a
Datetime
object with the current date and time; - Use the
strftime()
module to change the formatting in"%Y-%m-%d"
; - Print the type of the
dt
variable.
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 3