<jupyter_start><jupyter_text>Table of Contents<jupyter_code>import datetime
# set of objects for basic time
# date, time, and date time objects
# date(year, month, day) #in gregorian calendar
d1 = datetime.date(2015, 1, 23)
d1
d1.strftime("%A %m/%d/%y")
d2 = datetime.date(2015, 1, 19)
d2
d1 - d2
print(d1 - d2)
(d1-d2).days # time delta objects
datetime.date.today()
# time object
t1 = datetime.time(1, 2) # always 24hours
t1
t2 = datetime.time(18)
t2
t1.strftime('%I:%M %p')
# difference is not supported
t2 - t1
# relative times in a day, no date associated with it
#datetime
d1 = datetime.datetime.now()
d1
d2 = datetime.datetime.now()
d2
d2 - d1
datetime.datetime.strptime('1/1/15', '%m/%d/%y') #stringparsetime
# %a (%A) abbrev (full) weekday name
# w, weekday number (0 for sun,  -- 6)
# b, B abbrev (full) month name
# %d day of month [01, 31]
# H I, 24 hour, 12 hour clock
# j day of year
# m month
# M minute
# p AM/PM
# S second
# U W week number of year U sunday, M monday as first day of week
# y Y year without/with century
# tz<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13619402985074627, 'fraction_numerical': 0.054104477611940295, 'mean_word_length': 4.061320754716981, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '501700', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 453, 'n_tokens_neox': 414, 'n_words': 149, 'path': 'notebooks/advanced/datetime.ipynb', 'repo_name': 'chendaniely/2017-10-26-mckinsey', 'size': '1072'}