diff --git a/lib/util/logger.js b/lib/util/logger.js index f5423037e5..32dfb4a4b1 100644 --- a/lib/util/logger.js +++ b/lib/util/logger.js @@ -25,7 +25,7 @@ const levelWithCompensatedLength = { }; /* istanbul ignore next */ -const timestampFormat = () => moment().format('YYYY-MM-DD HH:mm:ss'); +const timestampFormat = () => moment().format(settings.get().advanced.timestamp_format); // Create logger const transports = { diff --git a/lib/util/settings.js b/lib/util/settings.js index 54db78275f..79a0426e2f 100644 --- a/lib/util/settings.js +++ b/lib/util/settings.js @@ -99,6 +99,12 @@ const defaults = { * Home Assistant status topic */ homeassistant_status_topic: 'hass/status', + + /** + * Configurable timestampFormat + * https://github.com/Koenkk/zigbee2mqtt/commit/44db557a0c83f419d66755d14e460cd78bd6204e + */ + timestamp_format: 'YYYY-MM-DD HH:mm:ss', }, }; @@ -152,6 +158,7 @@ const schema = { report: {type: 'boolean'}, homeassistant_discovery_topic: {type: 'string'}, homeassistant_status_topic: {type: 'string'}, + timestamp_format: {type: 'string'}, }, }, map_options: {