SHARE
TWEET

date formatting

DeaD_EyE Aug 18th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import datetime
  2.  
  3. date = datetime.date(2019, 8, 1)
  4.  
  5.  
  6. print(date.strftime('%b %-d, %Y'))
  7. # format string is not always better
  8. print(f'{date:%b} {date:%-d}, {date:%Y}')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top