On top of my notebook I currently have “Last Checkpoint: 01/25/2022 (autosaved)” displayed. I would like this in a civilised readable different format. However I can’t find the option to change this.
The only mentions of date
in the template config file (generated with jupyter notebook --generate-config
) are:
## The date format used by logging formatters for %(asctime)s
# Default: '%Y-%m-%d %H:%M:%S'
# c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'
## The date format used by logging formatters for %(asctime)s
# See also: Application.log_datefmt
# c.JupyterApp.log_datefmt = '%Y-%m-%d %H:%M:%S'
## The date format used by logging formatters for %(asctime)s
# See also: Application.log_datefmt
# c.NotebookApp.log_datefmt = '%Y-%m-%d %H:%M:%S'
All of those seem to refer to the logging and not to the displayed date. The config file contains no mention of locale or language. None of the environment variables I’ve tried have had any effect (including LANG
, LC_ALL
, LC_TIME
, etc.), though they do affect python’s locale.getdefaultlocale()
.
This is the output of jupyter --version for what it’s worth:
jupyter --version
Selected Jupyter core packages...
IPython : 8.0.1
ipykernel : 6.7.0
ipywidgets : 7.6.5
jupyter_client : 7.1.1
jupyter_core : 4.9.1
jupyter_server : not installed
jupyterlab : not installed
nbclient : 0.5.10
nbconvert : 6.4.0
nbformat : 5.1.3
notebook : 6.4.6
qtconsole : 5.2.2
traitlets : 5.1.1
jupyter notebook
I do see dates in YYYY-DD-MM format, such as Last Checkpoint: 01/13/2022 (autosaved)
Some tips - how did I figure this out?
var chkd = moment(this._checkpoint_date); ...; chkd.calendar();
, meaning this is formatted in the browser using the MomentJS librarymoment.locale(...)
- so we can search for this snippet in the code. We can see it here - moment.locale(_uiLang())
_uiLang
we can see it's just a wrapper around the browser language preference (source) - _uiLang = function() { return navigator.language.toLowerCase(); }