5

I want to have an "updated date" in my Jupyter Notebook markdown. Can someone tells me if I could have that date populated automatically? If so, how?

Thank you in advance!

Sunny Liu
  • 79
  • 1
  • 3

1 Answers1

2

You can use the IPython.display module in combination with datetime.

from datetime import datetime
from IPython.display import display, Markdown

todays_date = str(datetime.now().date())

display(Markdown(f'# Report for Week {todays_date}'))

Answer adapted from answers to the question: How to programmatically generate markdown output in Jupyter notebooks?

codeananda
  • 939
  • 1
  • 10
  • 16