Commit adcfc9703c43c1f462181f5e90283d024d8b6929
1 parent
eea77c59
TB-56: Improvement to the TimePlugin to support timezone operations
Showing
1 changed file
with
2 additions
and
2 deletions
@@ -30,7 +30,7 @@ import org.thingsboard.server.extensions.api.plugins.msg.RuleToPluginMsg; | @@ -30,7 +30,7 @@ import org.thingsboard.server.extensions.api.plugins.msg.RuleToPluginMsg; | ||
30 | import org.thingsboard.server.extensions.api.rules.RuleException; | 30 | import org.thingsboard.server.extensions.api.rules.RuleException; |
31 | import org.thingsboard.server.extensions.core.action.rpc.RpcPluginAction; | 31 | import org.thingsboard.server.extensions.core.action.rpc.RpcPluginAction; |
32 | 32 | ||
33 | -import java.time.LocalDateTime; | 33 | +import java.time.ZonedDateTime; |
34 | import java.time.format.DateTimeFormatter; | 34 | import java.time.format.DateTimeFormatter; |
35 | 35 | ||
36 | /** | 36 | /** |
@@ -51,7 +51,7 @@ public class TimePlugin extends AbstractPlugin<TimePluginConfiguration> implemen | @@ -51,7 +51,7 @@ public class TimePlugin extends AbstractPlugin<TimePluginConfiguration> implemen | ||
51 | 51 | ||
52 | String reply; | 52 | String reply; |
53 | if (!StringUtils.isEmpty(format)) { | 53 | if (!StringUtils.isEmpty(format)) { |
54 | - reply = "\"" + formatter.format(LocalDateTime.now()) + "\""; | 54 | + reply = "\"" + formatter.format(ZonedDateTime.now()) + "\""; |
55 | } else { | 55 | } else { |
56 | reply = Long.toString(System.currentTimeMillis()); | 56 | reply = Long.toString(System.currentTimeMillis()); |
57 | } | 57 | } |