diff --git a/docs/configuration/date-time.md b/docs/configuration/date-time.md deleted file mode 100644 index a23053e08..000000000 --- a/docs/configuration/date-time.md +++ /dev/null @@ -1,23 +0,0 @@ -# Date & Time Parameters - -## TIME_ZONE - -Default: UTC - -The time zone NetBox will use when dealing with dates and times. It is recommended to use UTC time unless you have a specific need to use a local time zone. Please see the [list of available time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - -## Date and Time Formatting - -You may define custom formatting for date and times. For detailed instructions on writing format strings, please see [the Django documentation](https://docs.djangoproject.com/en/stable/ref/templates/builtins/#date). Default formats are listed below. - -!!! note - These system defaults will be overridden by a user's selected language/locale when [localization](./system.md#enable_localization) is enabled. - -```python -DATE_FORMAT = 'N j, Y' # June 26, 2016 -SHORT_DATE_FORMAT = 'Y-m-d' # 2016-06-26 -TIME_FORMAT = 'g:i a' # 1:23 p.m. -SHORT_TIME_FORMAT = 'H:i:s' # 13:23:00 -DATETIME_FORMAT = 'N j, Y g:i a' # June 26, 2016 1:23 p.m. -SHORT_DATETIME_FORMAT = 'Y-m-d H:i' # 2016-06-26 13:23 -``` diff --git a/docs/configuration/system.md b/docs/configuration/system.md index 806839778..094d64ece 100644 --- a/docs/configuration/system.md +++ b/docs/configuration/system.md @@ -69,7 +69,7 @@ Email is sent from NetBox only for critical events or if configured for [logging Default: False -Determines if localization features are enabled or not. This should only be enabled for development or testing purposes as netbox is not yet fully localized. Turning this on will localize numeric and date formats (overriding any configured [system defaults](./date-time.md#date-and-time-formatting)) based on the browser locale as well as translate certain strings from third party modules. +Determines if localization features are enabled or not. This should only be enabled for development or testing purposes as netbox is not yet fully localized. Turning this on will localize numeric and date formats based on the browser locale as well as translate certain strings from third party modules. --- @@ -203,3 +203,9 @@ A dictionary of configuration parameters for the storage backend configured as ` If `STORAGE_BACKEND` is not defined, this setting will be ignored. --- + +## TIME_ZONE + +Default: UTC + +The time zone NetBox will use when dealing with dates and times. It is recommended to use UTC time unless you have a specific need to use a local time zone. Please see the [list of available time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). diff --git a/mkdocs.yml b/mkdocs.yml index 3db4734a4..7d586355f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -112,7 +112,6 @@ nav: - Default Values: 'configuration/default-values.md' - Error Reporting: 'configuration/error-reporting.md' - Plugins: 'configuration/plugins.md' - - Date & Time: 'configuration/date-time.md' - Miscellaneous: 'configuration/miscellaneous.md' - Development: 'configuration/development.md' - Customization: diff --git a/netbox/netbox/configuration_example.py b/netbox/netbox/configuration_example.py index f415ca42f..10aeb2e51 100644 --- a/netbox/netbox/configuration_example.py +++ b/netbox/netbox/configuration_example.py @@ -237,12 +237,3 @@ SESSION_FILE_PATH = None # Time zone (default: UTC) TIME_ZONE = 'UTC' - -# Date/time formatting. See the following link for supported formats: -# https://docs.djangoproject.com/en/stable/ref/templates/builtins/#date -DATE_FORMAT = 'N j, Y' -SHORT_DATE_FORMAT = 'Y-m-d' -TIME_FORMAT = 'g:i a' -SHORT_TIME_FORMAT = 'H:i:s' -DATETIME_FORMAT = 'N j, Y g:i a' -SHORT_DATETIME_FORMAT = 'Y-m-d H:i' diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 32daa137c..e8a21c68a 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -73,8 +73,6 @@ CSRF_COOKIE_SECURE = getattr(configuration, 'CSRF_COOKIE_SECURE', False) CSRF_TRUSTED_ORIGINS = getattr(configuration, 'CSRF_TRUSTED_ORIGINS', []) DATA_UPLOAD_MAX_MEMORY_SIZE = getattr(configuration, 'DATA_UPLOAD_MAX_MEMORY_SIZE', 2621440) DATABASE = getattr(configuration, 'DATABASE') # Required -DATE_FORMAT = getattr(configuration, 'DATE_FORMAT', 'N j, Y') -DATETIME_FORMAT = getattr(configuration, 'DATETIME_FORMAT', 'N j, Y g:i a') DEBUG = getattr(configuration, 'DEBUG', False) DEFAULT_DASHBOARD = getattr(configuration, 'DEFAULT_DASHBOARD', None) DEFAULT_PERMISSIONS = getattr(configuration, 'DEFAULT_PERMISSIONS', { @@ -152,12 +150,8 @@ SESSION_COOKIE_NAME = getattr(configuration, 'SESSION_COOKIE_NAME', 'sessionid') SESSION_COOKIE_PATH = CSRF_COOKIE_PATH SESSION_COOKIE_SECURE = getattr(configuration, 'SESSION_COOKIE_SECURE', False) SESSION_FILE_PATH = getattr(configuration, 'SESSION_FILE_PATH', None) -SHORT_DATE_FORMAT = getattr(configuration, 'SHORT_DATE_FORMAT', 'Y-m-d') -SHORT_DATETIME_FORMAT = getattr(configuration, 'SHORT_DATETIME_FORMAT', 'Y-m-d H:i') -SHORT_TIME_FORMAT = getattr(configuration, 'SHORT_TIME_FORMAT', 'H:i:s') STORAGE_BACKEND = getattr(configuration, 'STORAGE_BACKEND', None) STORAGE_CONFIG = getattr(configuration, 'STORAGE_CONFIG', {}) -TIME_FORMAT = getattr(configuration, 'TIME_FORMAT', 'g:i a') TIME_ZONE = getattr(configuration, 'TIME_ZONE', 'UTC') # Load any dynamic configuration parameters which have been hard-coded in the configuration file