Timestamp_custom dont show my local date format

good evening,
why, having set hassio in Italian (in fact in the hassio configuration pages I see the text in Italian), when I show the date with

‘timestamp_custom (’%A %-d %B’)’

I see it in English?
If I use timestamp_local I see it in Italian correctly but I need to customize it !!

Why ?
Thanks, Alberto

1 Like

no solution form this question ?

Consult finity’s EPIC time manipulation thread.
Just type epic in the search box.
What actual format do you require as a text output ?

language Italian

Yeah, you said that.
Can you give me an example of your required format ?

{{ as_timestamp(states.calendar.lavoro.attributes.start_time) | timestamp_custom('%d %A %H:%M') }}

Sorry, an example would be : - 2020/01/15, 20:52

Sorry Mutt, but I can’t understand your request.
Shouldn’t the date or time always be displayed in the local format?
If I use

timestamp_local

I see:
2020-01-16 09:00:00

but I need to break it down into several parts to make alexa say it so I need to use timestamp_custom like:

timestamp_custom ('% A% d% B')

Thursday 16 January
but I would need it in Italian:
Giovedì 16 Gennaio

Thanks, Alberto

Ah! Now a light comes on.
Sorry, not played with that sort of thing yet.
Maybe @finity could help ?

Nope. I’ve got nothing on how to make sure that Alexa says the dates in a different language.

I don’t believe that’s a timestamp issue but instead an Alexa issue.

Yeah, I thought as much, but can you get “Thursday 12th January” maybe he can work from there.

the “Thursday” & “January” are easy.

I don’t see a directive that returns the “12th” (the th is the issue).

As far as I know from my notes he is already using the correct directives to return the locales time (which should be in the correct language for that locale). Unless he has some other thing wrong with his configuration that doesn’t know it should be returning Italian instead of English. ??

Yep, got that but how about a macro in a template that in 1,21,31 gives st - 2,22 gives nd - 3,23 gives rd else th? Or will we need petro ?

That would be useful on its own (but specific to English) though from the example, easily modified

I’m sure it would be possible to come up with something (maybe tomorrow…gotta sleep sometime…I’d like to think… :tired_face:) but I still think the right answer is to figure out why the locale is wrong in the first place as opposed to trying to template around the issue.

it requires setting the python installation to Italian. Which the dev’s will not do. Gotta convert the days and text yourself. Super annoying but it is what it is.

2 Likes

An interesting read all on its own.
Many thanks.
I tried to bookmark, this and nearly flagged it instead. Oooooops :rofl: :beer:

Edit, you weren’t tagged so I guess your ears must have been burning :rofl: