DateTime type Input in Dash Input


#1

Hi All,

Need an urgent help on this.

I am trying to get dcc.Input with type “datetime-local” working as a dash Input.

Need help figuring out how to change the display format

Currently the datetime is shown in the local system format, where as i want to show YYYY-MM-DD HH:MM format.

image

html.Div([
html.Label(‘Start Time:’),
dcc.Input(
id=‘start-time-input’,
type=‘datetime-local’,
value=dt.strftime(dt.utcnow() - pd.offsets.BDay(10), ‘%Y-%m-%dT%H:%M’),
className=‘form-control’,
),
]),
html.Div([
html.Label(‘End Time:’),
dcc.Input(
id=‘end-time-input’,
type=‘datetime-local’,
value=dt.strftime(dt.utcnow() - pd.offsets.Minute(10), ‘%Y-%m-%dT%H:%M’),
className=‘form-control’,
),
]),

Thanks
M