如何在 Dash 应用程序(Python 框架)上插入今天的日期和时间

How to insert today's Date and Time on Dash App (Python Framework)

我正在创建一个 python 应用程序(DASH 应用程序)检查这里是什么破折号 (https://youtu.be/5BAthiN0htc) 我想插入 今天的日期和时间 . 你能帮我把它添加到我的应用程序吗?

谢谢,

下面我为可能遇到类似问题的人提供解决方案:

代码应该类似于下面的代码,并将其放在 Dash 应用程序的 DIV 中 ( app.layout = html.Div([ )。我放置属性以允许您自定义显示格式。

import datetime

html.Div([
                html.H1(
                datetime.datetime.now().strftime('%Y-%m-%d'), style=
{'opacity': '1','color': 'white', 'fontSize': 12}),
                html.H1(datetime.datetime.now().strftime('%H:%M:%S'), style=
{'opacity': '1','color': 'white', 'fontSize': 12}),
            ],

        ], 

        html.Br([]),


2018-02-24
19:33:39