Trying to update time stamp % displayed in date string

Hi!
Been spending time trying to sort out why I can’t get rid of the “%” in my timestamp updates, but without luck. Probably something simple ?

I have the following item:

DateTime MyLastUpdate   "[%1$tY-%1$tm-%1$td %1$tH:%1$tM]" <clock> 

And the rule:

import org.openhab.core.library.types.*
rule "UpdateTimestamp"
when
  Item MyItem received update
then
  logInfo("UpdateTimeStamp", "Updating timestamp..")
  PlantPiffLastUpdate.postUpdate(new DateTimeType())
end

The result is:
%2016-11-21 21:04

Anyone got any idea on how do I get rid of the “%” ?

Regards, S

It might be a bug in how the label is displayed in the client. Could you change your item definition to:

DateTime MyLastUpdate   "LastUpdate [%1$tY-%1$tm-%1$td %1$tH:%1$tM]" <clock>

and see if the formatting gets cleared up? If not, in which client(s) are you seeing this?

Hi!

Thanks for the quick reply!
Yes your suggestion seem to fix it. I see this on android openhab client and in the basicui using firefox.

Regards, S

1 Like