Submit Search
Upload
Python Programming Essentials - M23 - datetime module
•
0 likes
•
1,402 views
P3 InfoTech Solutions Pvt. Ltd.
Follow
Slides from the training on the topic "Python Programming Essentials"
Read less
Read more
Report
Share
Report
Share
1 of 15
Recommended
Python datetime
Python datetime
sureshraj43
Python Modules
Python Modules
Nitin Reddy Katkam
Dynamic memory allocation in c++
Dynamic memory allocation in c++
Tech_MX
Oops ppt
Oops ppt
abhayjuneja
Pointers in c++
Pointers in c++
Vineeta Garg
Python Matplotlib Tutorial | Matplotlib Tutorial | Python Tutorial | Python T...
Python Matplotlib Tutorial | Matplotlib Tutorial | Python Tutorial | Python T...
Edureka!
Object Oriented Programming Using C++
Object Oriented Programming Using C++
Muhammad Waqas
Datatypes in python
Datatypes in python
eShikshak
Recommended
Python datetime
Python datetime
sureshraj43
Python Modules
Python Modules
Nitin Reddy Katkam
Dynamic memory allocation in c++
Dynamic memory allocation in c++
Tech_MX
Oops ppt
Oops ppt
abhayjuneja
Pointers in c++
Pointers in c++
Vineeta Garg
Python Matplotlib Tutorial | Matplotlib Tutorial | Python Tutorial | Python T...
Python Matplotlib Tutorial | Matplotlib Tutorial | Python Tutorial | Python T...
Edureka!
Object Oriented Programming Using C++
Object Oriented Programming Using C++
Muhammad Waqas
Datatypes in python
Datatypes in python
eShikshak
Python programming : Standard Input and Output
Python programming : Standard Input and Output
Emertxe Information Technologies Pvt Ltd
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
Input processing and output in Python
Input processing and output in Python
MSB Academy
Python ppt
Python ppt
Rohit Verma
Python libraries
Python libraries
Prof. Dr. K. Adisesha
Python programming : Files
Python programming : Files
Emertxe Information Technologies Pvt Ltd
Pointers in c++
Pointers in c++
sai tarlekar
Oop concepts in python
Oop concepts in python
baabtra.com - No. 1 supplier of quality freshers
Exception handling
Exception handling
Pranali Chaudhari
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Edureka!
Chapter 07 inheritance
Chapter 07 inheritance
Praveen M Jigajinni
Python-Encapsulation.pptx
Python-Encapsulation.pptx
Karudaiyar Ganapathy
Exception Handling in JAVA
Exception Handling in JAVA
SURIT DATTA
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Andrew Ferlitsch
Python basics
Python basics
Hoang Nguyen
Date and Time Module in Python | Edureka
Date and Time Module in Python | Edureka
Edureka!
Python Flow Control
Python Flow Control
Kamal Acharya
Constructor
Constructor
poonamchopra7975
Gui programming
Gui programming
manikanta361
Python-01| Fundamentals
Python-01| Fundamentals
Mohd Sajjad
Python Programming Essentials - M4 - Editors and IDEs
Python Programming Essentials - M4 - Editors and IDEs
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M10 - Numbers and Artihmetic Operators
Python Programming Essentials - M10 - Numbers and Artihmetic Operators
P3 InfoTech Solutions Pvt. Ltd.
More Related Content
What's hot
Python programming : Standard Input and Output
Python programming : Standard Input and Output
Emertxe Information Technologies Pvt Ltd
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
Input processing and output in Python
Input processing and output in Python
MSB Academy
Python ppt
Python ppt
Rohit Verma
Python libraries
Python libraries
Prof. Dr. K. Adisesha
Python programming : Files
Python programming : Files
Emertxe Information Technologies Pvt Ltd
Pointers in c++
Pointers in c++
sai tarlekar
Oop concepts in python
Oop concepts in python
baabtra.com - No. 1 supplier of quality freshers
Exception handling
Exception handling
Pranali Chaudhari
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Edureka!
Chapter 07 inheritance
Chapter 07 inheritance
Praveen M Jigajinni
Python-Encapsulation.pptx
Python-Encapsulation.pptx
Karudaiyar Ganapathy
Exception Handling in JAVA
Exception Handling in JAVA
SURIT DATTA
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Andrew Ferlitsch
Python basics
Python basics
Hoang Nguyen
Date and Time Module in Python | Edureka
Date and Time Module in Python | Edureka
Edureka!
Python Flow Control
Python Flow Control
Kamal Acharya
Constructor
Constructor
poonamchopra7975
Gui programming
Gui programming
manikanta361
Python-01| Fundamentals
Python-01| Fundamentals
Mohd Sajjad
What's hot
(20)
Python programming : Standard Input and Output
Python programming : Standard Input and Output
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Input processing and output in Python
Input processing and output in Python
Python ppt
Python ppt
Python libraries
Python libraries
Python programming : Files
Python programming : Files
Pointers in c++
Pointers in c++
Oop concepts in python
Oop concepts in python
Exception handling
Exception handling
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Python Loops Tutorial | Python For Loop | While Loop Python | Python Training...
Chapter 07 inheritance
Chapter 07 inheritance
Python-Encapsulation.pptx
Python-Encapsulation.pptx
Exception Handling in JAVA
Exception Handling in JAVA
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python basics
Python basics
Date and Time Module in Python | Edureka
Date and Time Module in Python | Edureka
Python Flow Control
Python Flow Control
Constructor
Constructor
Gui programming
Gui programming
Python-01| Fundamentals
Python-01| Fundamentals
Viewers also liked
Python Programming Essentials - M4 - Editors and IDEs
Python Programming Essentials - M4 - Editors and IDEs
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M10 - Numbers and Artihmetic Operators
Python Programming Essentials - M10 - Numbers and Artihmetic Operators
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M9 - String Formatting
Python Programming Essentials - M9 - String Formatting
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M8 - String Methods
Python Programming Essentials - M8 - String Methods
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M21 - Exception Handling
Python Programming Essentials - M21 - Exception Handling
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M7 - Strings
Python Programming Essentials - M7 - Strings
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M1 - Course Introduction
Python Programming Essentials - M1 - Course Introduction
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M40 - Invoking External Programs
Python Programming Essentials - M40 - Invoking External Programs
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M28 - Debugging with pdb
Python Programming Essentials - M28 - Debugging with pdb
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M31 - PEP 8
Python Programming Essentials - M31 - PEP 8
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M44 - Overview of Web Development
Python Programming Essentials - M44 - Overview of Web Development
P3 InfoTech Solutions Pvt. Ltd.
Viewers also liked
(11)
Python Programming Essentials - M4 - Editors and IDEs
Python Programming Essentials - M4 - Editors and IDEs
Python Programming Essentials - M10 - Numbers and Artihmetic Operators
Python Programming Essentials - M10 - Numbers and Artihmetic Operators
Python Programming Essentials - M9 - String Formatting
Python Programming Essentials - M9 - String Formatting
Python Programming Essentials - M8 - String Methods
Python Programming Essentials - M8 - String Methods
Python Programming Essentials - M21 - Exception Handling
Python Programming Essentials - M21 - Exception Handling
Python Programming Essentials - M7 - Strings
Python Programming Essentials - M7 - Strings
Python Programming Essentials - M1 - Course Introduction
Python Programming Essentials - M1 - Course Introduction
Python Programming Essentials - M40 - Invoking External Programs
Python Programming Essentials - M40 - Invoking External Programs
Python Programming Essentials - M28 - Debugging with pdb
Python Programming Essentials - M28 - Debugging with pdb
Python Programming Essentials - M31 - PEP 8
Python Programming Essentials - M31 - PEP 8
Python Programming Essentials - M44 - Overview of Web Development
Python Programming Essentials - M44 - Overview of Web Development
Similar to Python Programming Essentials - M23 - datetime module
Synapse india dotnet development overloading operater part 4
Synapse india dotnet development overloading operater part 4
Synapseindiappsdevelopment
Approaching real-time-hadoop
Approaching real-time-hadoop
Chris Huang
Easy path to machine learning (Spring 2021)
Easy path to machine learning (Spring 2021)
wesley chun
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Feb-2021_L2_...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Feb-2021_L2_...
MaruMengesha
Rethinking metrics: metrics 2.0 @ Lisa 2014
Rethinking metrics: metrics 2.0 @ Lisa 2014
Dieter Plaetinck
Csphtp1 08
Csphtp1 08
HUST
Implement angular calendar component how to drag & create events
Implement angular calendar component how to drag & create events
Katy Slemon
Domain Driven Design In C#3.0
Domain Driven Design In C#3.0
Pieter Joost van de Sande
Jsr310
Jsr310
彥彬 洪
仕事ではじめる機械学習
仕事ではじめる機械学習
Aki Ariga
enum_comp_exercicio01.docx
enum_comp_exercicio01.docx
Michel Valentim
From SQLAlchemy to Ming with TurboGears2
From SQLAlchemy to Ming with TurboGears2
Alessandro Molina
Connecting and Visualising Open Data from Multiple Sources
Connecting and Visualising Open Data from Multiple Sources
Margriet Groenendijk
Visualising and Linking Open Data from Multiple Sources
Visualising and Linking Open Data from Multiple Sources
Data Driven Innovation
DataXDay - Tensors in the sky with CloudML
DataXDay - Tensors in the sky with CloudML
DataXDay Conference by Xebia
Java22_1670144363.pptx
Java22_1670144363.pptx
DilanAlmsa
Easy path to machine learning
Easy path to machine learning
wesley chun
Building a custom machine learning model on android
Building a custom machine learning model on android
Isabel Palomar
Info Session: 30 Days of Google Cloud
Info Session: 30 Days of Google Cloud
SuyashDahake1
#NoEstimates project planning using Monte Carlo simulation
#NoEstimates project planning using Monte Carlo simulation
Dimitar Bakardzhiev
Similar to Python Programming Essentials - M23 - datetime module
(20)
Synapse india dotnet development overloading operater part 4
Synapse india dotnet development overloading operater part 4
Approaching real-time-hadoop
Approaching real-time-hadoop
Easy path to machine learning (Spring 2021)
Easy path to machine learning (Spring 2021)
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Feb-2021_L2_...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_04-Feb-2021_L2_...
Rethinking metrics: metrics 2.0 @ Lisa 2014
Rethinking metrics: metrics 2.0 @ Lisa 2014
Csphtp1 08
Csphtp1 08
Implement angular calendar component how to drag & create events
Implement angular calendar component how to drag & create events
Domain Driven Design In C#3.0
Domain Driven Design In C#3.0
Jsr310
Jsr310
仕事ではじめる機械学習
仕事ではじめる機械学習
enum_comp_exercicio01.docx
enum_comp_exercicio01.docx
From SQLAlchemy to Ming with TurboGears2
From SQLAlchemy to Ming with TurboGears2
Connecting and Visualising Open Data from Multiple Sources
Connecting and Visualising Open Data from Multiple Sources
Visualising and Linking Open Data from Multiple Sources
Visualising and Linking Open Data from Multiple Sources
DataXDay - Tensors in the sky with CloudML
DataXDay - Tensors in the sky with CloudML
Java22_1670144363.pptx
Java22_1670144363.pptx
Easy path to machine learning
Easy path to machine learning
Building a custom machine learning model on android
Building a custom machine learning model on android
Info Session: 30 Days of Google Cloud
Info Session: 30 Days of Google Cloud
#NoEstimates project planning using Monte Carlo simulation
#NoEstimates project planning using Monte Carlo simulation
More from P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M39 - Unit Testing
Python Programming Essentials - M39 - Unit Testing
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M37 - Brief Overview of Misc Concepts
Python Programming Essentials - M37 - Brief Overview of Misc Concepts
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M35 - Iterators & Generators
Python Programming Essentials - M35 - Iterators & Generators
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M34 - List Comprehensions
Python Programming Essentials - M34 - List Comprehensions
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M29 - Python Interpreter and Files
Python Programming Essentials - M29 - Python Interpreter and Files
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M27 - Logging module
Python Programming Essentials - M27 - Logging module
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M25 - os and sys modules
Python Programming Essentials - M25 - os and sys modules
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M24 - math module
Python Programming Essentials - M24 - math module
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M22 - File Operations
Python Programming Essentials - M22 - File Operations
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M20 - Classes and Objects
Python Programming Essentials - M20 - Classes and Objects
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M19 - Namespaces, Global Variables and Docstr...
Python Programming Essentials - M19 - Namespaces, Global Variables and Docstr...
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M18 - Modules and Packages
Python Programming Essentials - M18 - Modules and Packages
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M17 - Functions
Python Programming Essentials - M17 - Functions
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M16 - Control Flow Statements and Loops
Python Programming Essentials - M16 - Control Flow Statements and Loops
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M15 - References
Python Programming Essentials - M15 - References
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M14 - Dictionaries
Python Programming Essentials - M14 - Dictionaries
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M13 - Tuples
Python Programming Essentials - M13 - Tuples
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M12 - Lists
Python Programming Essentials - M12 - Lists
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M11 - Comparison and Logical Operators
Python Programming Essentials - M11 - Comparison and Logical Operators
P3 InfoTech Solutions Pvt. Ltd.
Python Programming Essentials - M6 - Code Blocks and Indentation
Python Programming Essentials - M6 - Code Blocks and Indentation
P3 InfoTech Solutions Pvt. Ltd.
More from P3 InfoTech Solutions Pvt. Ltd.
(20)
Python Programming Essentials - M39 - Unit Testing
Python Programming Essentials - M39 - Unit Testing
Python Programming Essentials - M37 - Brief Overview of Misc Concepts
Python Programming Essentials - M37 - Brief Overview of Misc Concepts
Python Programming Essentials - M35 - Iterators & Generators
Python Programming Essentials - M35 - Iterators & Generators
Python Programming Essentials - M34 - List Comprehensions
Python Programming Essentials - M34 - List Comprehensions
Python Programming Essentials - M29 - Python Interpreter and Files
Python Programming Essentials - M29 - Python Interpreter and Files
Python Programming Essentials - M27 - Logging module
Python Programming Essentials - M27 - Logging module
Python Programming Essentials - M25 - os and sys modules
Python Programming Essentials - M25 - os and sys modules
Python Programming Essentials - M24 - math module
Python Programming Essentials - M24 - math module
Python Programming Essentials - M22 - File Operations
Python Programming Essentials - M22 - File Operations
Python Programming Essentials - M20 - Classes and Objects
Python Programming Essentials - M20 - Classes and Objects
Python Programming Essentials - M19 - Namespaces, Global Variables and Docstr...
Python Programming Essentials - M19 - Namespaces, Global Variables and Docstr...
Python Programming Essentials - M18 - Modules and Packages
Python Programming Essentials - M18 - Modules and Packages
Python Programming Essentials - M17 - Functions
Python Programming Essentials - M17 - Functions
Python Programming Essentials - M16 - Control Flow Statements and Loops
Python Programming Essentials - M16 - Control Flow Statements and Loops
Python Programming Essentials - M15 - References
Python Programming Essentials - M15 - References
Python Programming Essentials - M14 - Dictionaries
Python Programming Essentials - M14 - Dictionaries
Python Programming Essentials - M13 - Tuples
Python Programming Essentials - M13 - Tuples
Python Programming Essentials - M12 - Lists
Python Programming Essentials - M12 - Lists
Python Programming Essentials - M11 - Comparison and Logical Operators
Python Programming Essentials - M11 - Comparison and Logical Operators
Python Programming Essentials - M6 - Code Blocks and Indentation
Python Programming Essentials - M6 - Code Blocks and Indentation
Python Programming Essentials - M23 - datetime module
1.
http://www.skillbrew.com /SkillbrewTalent brewed by
the industry itself Datetime module Pavan Verma @YinYangPavan 1 Founder, P3 InfoTech Solutions Pvt. Ltd. Python Programming Essentials
2.
© SkillBrew http://skillbrew.com Introduction
to datetime module 2 The datetime module supplies classes for manipulating dates and times Key classes in datetime module Date Time Datetime Timedelta tzinfo
3.
© SkillBrew http://skillbrew.com Types
of datetime objects Date and Time objects Naive objects Aware objects 3 Naive objects are not aware of time zones and day-light savings but they are pretty easy to understand An aware object has sufficient knowledge of time zones and day-light savings
4.
© SkillBrew http://skillbrew.com Note 4 All
examples in these slides are using naive objects
5.
© SkillBrew http://skillbrew.com Date
objects 5 from datetime import date d = date(2013, 8, 22) print(d.year) print(d.month) print(d.day) print(d.strftime("%Y %m %d")) Output: 2013 8 22 2013 08 22
6.
© SkillBrew http://skillbrew.com Date
objects (2) 6 >>> from datetime import date >>> date.today() datetime.date(2013, 10, 21)
7.
© SkillBrew http://skillbrew.com Time
objects 7 from datetime import time t = time(2, 30, 45) print(t.hour) print(t.minute) print(t.second) print(t.strftime("%H:%M:%S")) Output: 2 30 45 02:30:45
8.
© SkillBrew http://skillbrew.com DateTime
objects 8 from datetime import datetime dt = datetime(2013, 8, 21, 2, 30, 45) print(dt.hour) print(dt.minute) print(dt.second) print(dt.strftime("%m-%d-%Y %H:%M:%S")) Output: 2 30 45 08-21-2013 02:30:45
9.
© SkillBrew http://skillbrew.com Manipulating
dates 9 from datetime import datetime, timedelta dt = datetime(2013, 8, 21, 2, 30, 45) print(dt.strftime("%m-%d-%Y %H:%M:%S")) Output: 08-21-2013 02:30:45
10.
© SkillBrew http://skillbrew.com Manipulating
dates (2) 10 from datetime import datetime, timedelta dt = datetime(2013, 8, 21, 2, 30, 45) # get datetime after 5 days add_dt = dt + timedelta(days=5) print(add_dt.strftime("%m-%d-%Y %H:%M:%S")) Output: 08-26-2013 02:30:45
11.
© SkillBrew http://skillbrew.com Manipulating
dates (3) 11 from datetime import datetime, timedelta dt = datetime(2013, 8, 21, 2, 30, 45) # get datetime after 5 days add_dt = dt + timedelta(days=5) # get datetime 2 days in past sub_dt = dt - timedelta(days=2) print(sub_dt.strftime("%m-%d-%Y %H:%M:%S")) Output: 08-19-2013 02:30:45
12.
© SkillBrew http://skillbrew.com Manipulating
dates (4) 12 from datetime import datetime, timedelta dt = datetime(2013, 8, 21, 2, 30, 45) # get datetime after 5 days add_dt = dt + timedelta(days=5) # get datetime 2 days in past sub_dt = dt - timedelta(days=2) # comparison print add_dt > sub_dt Output: True
13.
© SkillBrew http://skillbrew.com Manipulating
dates (5) 13 from datetime import datetime, timedelta dt = datetime(2013, 8, 21, 2, 30, 45) # get datetime after 5 days add_dt = dt + timedelta(days=5) # get datetime 2 days in past sub_dt = dt - timedelta(days=2) # comparison add_dt > sub_dt # subtract print add_dt - sub_dt Output: 7 days, 0:00:00
14.
© SkillBrew http://skillbrew.com Summary
Introduction to datetime module Types of datetime objects Date objects Time objects Datetime objects Manipulating Dates 14
15.
© SkillBrew http://skillbrew.com Resources
Datetime objects blog post http://buddylindsey.com/python-date-and-datetime- objects-getting-to-know-them/ http://docs.python.org/2/library/datetime.html 15