Eric
(Eric Tsai)
September 20, 2015, 12:23am
1
When displaying date and time, the string gets pretty long. For example
Saturday, 09/19, 7:13AM.
How do you abbreviate Saturday to just “sat”? The item definition looks like this.
DateTime my_timestamp “Time [%1$tA, %1$tm/%1$td, %1$tI:%1$tM %1$tp]”
Thanks!
g_g_rich
(g_g_rich)
September 20, 2015, 2:28am
2
1 Like
Eric
(Eric Tsai)
September 20, 2015, 4:40am
3
Thanks! That’s probably the third time someone’s linked that to one of my date/time questions. I had a hard time finding it.
Much appreciated.
SmartJan
(SmartJanitor)
August 15, 2017, 9:47pm
4
As a newbie, I also struggle with DateTime and formatting, thus an update to this old thread:
With Java 8, here the new link: https://docs.oracle.com/javase/8/docs/api/index.html?java/util/Formatter.html
Also note that you might find in openhab.org examples yet of joda.time. But it seems mostly depreciated and included in the Java 8 classes according to the main developer .