Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

DateTime object representing DateTime in Python

# Python program to demonstrate datetime object
# import datetime class
from datetime import datetime

# Initializing constructor
my_date1 = datetime(1999, 3, 5)
print(my_date1)

# Initializing constructor with the time aslo
my_date2 = datetime(1999, 3, 5, 9, 11, 59, 342380)
print(my_date2)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #DateTime #object #representing #DateTime #Python
ADD COMMENT
Topic
Name
3+8 =