From b78f6127cced926b1c6e8b58ae44eb75eedc0a78 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 28 Nov 2024 17:00:58 +0100 Subject: [PATCH] Add blog about homeassistant.util.dt.utc_to_timestamp deprecation (#2476) --- ...2024-11-28-dt-util-utc-to-timestamp-deprecation.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 blog/2024-11-28-dt-util-utc-to-timestamp-deprecation.md diff --git a/blog/2024-11-28-dt-util-utc-to-timestamp-deprecation.md b/blog/2024-11-28-dt-util-utc-to-timestamp-deprecation.md new file mode 100644 index 00000000..3a8d6028 --- /dev/null +++ b/blog/2024-11-28-dt-util-utc-to-timestamp-deprecation.md @@ -0,0 +1,11 @@ +--- +author: Erik Montnemery +authorURL: https://github.com/emontnemery +title: "Utility function homeassistant.util.dt.utc_to_timestamp is deprecated" +--- + +The utility function `homeassistant.util.dt.utc_to_timestamp` is deprecated and will be removed in Home Assistant Core 2026.1, custom integrations which call it should instead call the stdlib method `datetime.datetime.timestamp()` + +The reason for deprecation is that the stdlib method is just as fast as the utility function. + +More details can be found in the [core PR](https://github.com/home-assistant/core/pull/131787). \ No newline at end of file