Global Parameter to Show Localized DateTime

Hi,
I’m using CalDAV Bindings to retrieve some events from calendar and show on OpenHab.
I use NAMEANDTIME value to have a string with name and time of the values.
Here is the item:

String CAL_TERMOSTATO_PROSSIMO_EVENTO_DESC "Prossimo Evento [%s]" <calendar> { caldavPersonal="calendar:casaOH type:UPCOMING eventNr:1 value:NAMEANDTIME" }

What was shown, is right event Name and Time, but it is not format in Italian:

Is there a way to format this via some global parameter, or this kind of formatting is harcoded into bindings and I have to use rules to compose my custom string?

Many Thanks

Marco

Given that it is just a String being returned from the caldav binding, unless that binding provides a way to format the date string you will have to parse it out in a Rule. I don’t know this binding so have no ideas whether it can do that or not.

Hi @rlkoshak,
I asked it because in my mind there should be a global parameter that set local settings like date format, as windows do.
I’ll procede with Rule.
Many Thanks

There is but you are not getting a DateTime from the binding. You are getting a String. A String is just a bunch of characters as far as the code is concerned. If you had a DateTime I believe it would pick up the proper formatting from your system’s localization parameters or you could easily format it using the %1tM type formattting in the label. But if all you have is a String you have to parse it yourself.

Hi @rlkoshak
It’s clear what you saying. I think that also binding apply the Locale setting/parsing to Datetime before converting to string and place in output.
Perhaps is a binding limitation, as you said.
Thanks and kindly regards

Marco