# (Partial) Map for day in DateTime item

**URL:** <https://community.openhab.org/t/partial-map-for-day-in-datetime-item/28845>\
**Category:** Items & Sitemaps\
**Created:** [May 23, 2017, 8:21am UTC](https://community.openhab.org/t/partial-map-for-day-in-datetime-item/28845 "2017-05-23T08:21:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![michel53](https://community.openhab.org/user_avatar/community.openhab.org/michel53/32/10303_2.png) [@michel53](https://community.openhab.org/u/michel53)\
**Post date:** [May 23, 2017, 8:21am UTC](https://community.openhab.org/t/partial-map-for-day-in-datetime-item/28845/1 "2017-05-23T08:21:38Z")

</div>

Hi all,  
I would like to format a DateTime item like this:

```csv
DateTime Date_actual "Datum/Zeit [%1$ta, %1$td.%1$tm.%1$tY %1$tH:%1$tM]"

```

That works and shows the day of week in locale (default english):  
Tue, 23.05.2017 10:16  
That’s fine so far, but I would like to get the day of week in german.  
I don’t want to change the locale to get errors in english (better for forum support…🙂)  
So I tried

```csv
DateTime Date_actual "Datum/Zeit [MAP(weekdays_de.map):%1$ta, %1$td.%1$tm.%1$tY %1$tH:%1$tM]"

```

and

```csv
DateTime Date_actual "Datum/Zeit [MAP(weekdays_de.map):%1$ta][, %1$td.%1$tm.%1$tY %1$tH:%1$tM]"

```

but this does not work.  
I could add a rule to format the item, but is there an easier way for a (partial) map of a DateTime item?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [May 23, 2017, 2:47pm UTC](https://community.openhab.org/t/partial-map-for-day-in-datetime-item/28845/2 "2017-05-23T14:47:00Z")

</div>

I don’t think you can do this without a rule. The problem is that the MAP operates on the entire state of the Item, not just the parts. I don’t think you can pass the formatted part of the Item’s state to MAP.

There might be something clever one could do with a JavaScript transform but I’m not certain. I’d just write a rule.

---

<div class="post-metadata">

**Author:** ![Udo\_Hartmann](https://community.openhab.org/user_avatar/community.openhab.org/udo_hartmann/32/70871_2.png) [@Udo\_Hartmann](https://community.openhab.org/u/Udo_Hartmann)\
**Post date:** [May 23, 2017, 4:58pm UTC](https://community.openhab.org/t/partial-map-for-day-in-datetime-item/28845/3 "2017-05-23T16:58:36Z")

</div>

If you want german weekdays (and also months) just set the locales (LC\_ALL, LANG, LANGUAGE) to de\_DE.utf-8 for the openhab user, there is no need for mapping the weekdays.

---

<div class="post-metadata">

**Author:** ![michel53](https://community.openhab.org/user_avatar/community.openhab.org/michel53/32/10303_2.png) [@michel53](https://community.openhab.org/u/michel53)\
**Post date:** [May 24, 2017, 5:25am UTC](https://community.openhab.org/t/partial-map-for-day-in-datetime-item/28845/4 "2017-05-24T05:25:48Z")

</div>

Thanks Rich, Udo.  
Udo, when changing the locales, aren’t all other things (f.e. error messages) also in german?  
That might be bad to tell the correct error in english for (forum) support…

---

<div class="post-metadata">

**Author:** ![Udo\_Hartmann](https://community.openhab.org/user_avatar/community.openhab.org/udo_hartmann/32/70871_2.png) [@Udo\_Hartmann](https://community.openhab.org/u/Udo_Hartmann)\
**Post date:** [May 24, 2017, 1:44pm UTC](https://community.openhab.org/t/partial-map-for-day-in-datetime-item/28845/5 "2017-05-24T13:44:02Z")

</div>

No, it’s only UI 🙂 (I think, more or less it’s only date conversion and maybe comma instead of period)

If you want to avoid a completely localized linux, you can set the locale within the openHAB ‘start sequence’

Well, formally this was easy, just set LANG right before starting the java command… but I’m pretty sure this is still possible…
