Horario de verano

Hola, me encuentro con el siguiente problema:
Al usar la función “call.timer.FormatTime from instant with pattern” y pasándole el resultado de “call.timer.MakeInstantFromMillis”, el resultado en estos momentos es un texto que indica una hora más de la que realmente es en España.
¿Alguna sugerencia?


Hi, I encounter the following problem:
When using the “call.timer.FormatTime from instant with pattern” function and passing it the result of “call.timer.MakeInstantFromMillis”, the result at the moment is a text that indicates one more hour than it really is in Spain.
Any suggestions?
(Google Translate by Taifun)

Have you tried Clock.SystemTime as well as Clock.Now ?

this probably happens because the result time is in UTC?

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

As @Taifun says, there is a problem in the timezone you are working at.

The makeInstantFromMillis returns an instant which is equivalent to the UNIX timestamp (unixtimestamp.com), as it starts in 1970.
And this timestamp is in the UTC timezone, which is not the same as the one we have in Spain (which is CET in winter and CEST in summer).

The most likely issue here is the following one:

As you can see, it is adding an extra hour because of the automatic time conversion. To solve it, you should substract an hour from the given millis (which are 3600000 millis).

I made the following blocks as a “manual timezone conversion” from user time to UTC, and viceversa:

However, it is not a real timezone converter, as the timezone stored in the instant will still be user local one.


When trying to solve this, I missed the ability to modify the instant timezone.
@ewpatton maybe we could add some blocks to work with timezones in instants? At least to be able to convert different times and avoid this issue.

EDITED:

2 Likes

Seems like it would be helpful to have add that into Clock component

Gracias por los aoprtes