esphome / esphome/feature-requests

Add full support for all strftime formats (especially without leading 0)

Open
#2,379 1 comment 6 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**
The strftime will not accept all formats to format time. For example all formats to delete leading '0' from days or of the month or hours is not implemented.

**Please describe your use case for this integration and alternatives you've tried:**
it.strftime(0, 0, id(font), "%-d", id(time).now()); generates errors or NAN's because ESPhome does not accept format "%-d", which normally would cancel the leading 0 before the date. "$#d", generally used for Windows, does not work either.

**Additional context**
It would be great if this was implemented, it would greatly improve how dates and time can be displayed.

Contributor guide

No contributing guide indexed for this repository

Research direction

The request names no source file, entry point, or test. Start by locating ESPHome’s strftime handling and checking how format directives are currently supported, then verify the requested %-d and Windows $#d cases; done means these formats render without errors or NaNs.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.