Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python get first day of year

import datetime
today = datetime.datetime.now()
thisYear = today.year
firstDay = datetime.datetime(thisYear, 1, 1)
firstDayStr = firstDay.strftime('%Y')
Comment

PREVIOUS NEXT
Code Example
Python :: round down a number python 
Python :: word generator in python 
Python :: df only take 2 columns 
Python :: make linked list in python 
Python :: Palindrome Check using for loop in python 
Python :: python selenium get text of div 
Python :: sang nguyen to python 
Python :: clear text box tkinter python 
Python :: factorial program 
Python :: python convert timestamp to datetime 
Python :: plotting two columns of a dataframe in python 
Python :: python iterate backwards through list 
Python :: how to get the type of a variable in python 
Python :: negative index in python list 
Python :: python check if two sets intersect 
Python :: numpy add one column 
Python :: how to count unique values in dataframe df python 
Python :: width and height of pil image 
Python :: changing the current working directory in python 
Python :: integer colomn to datetime pandas 
Python :: how to change username of a bot using discord.py 
Python :: how to add mouse button in pygame 
Python :: get rid of unnamed column pandas 
Python :: python turtle commands 
Python :: template string python 
Python :: python remove string from string 
Python :: flask flash not working 
Python :: Python Requests Library Get Method 
Python :: how to import file from another directory in python 
Python :: application/x-www-form-urlencoded python 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =