Open janvda opened 5 years ago
You might be interested in jsonata-moment. You could also add your own. If those functions are popular, maybe they would be merged into the core language spec and included across the different implementations of JSONata
Thought I'd mention I just came across this problem!
@andrew-coleman & @mattbaileyuk: what would you think of this approach to solve this issue?
The idea is to take the current timezone param and rename it to "offset", by keeping the offset value/logic like it was - and add a new timezone param which could dynamicly ajust the time to the valid tzdata(IANA) based timezone (summer/winter time and all further strange cases included..). All of this by don't have any breaking code changes - only for documentation ...
Targets: $now()
and $fromMillis()
If it's OK, I could clean it up and provide a pull for it.
The function $fromMillis() can be used to convert a time to a string but it doesn't take the locale settings into account. (I know that it is possible to specify a timezone as parameter but due to daylight saving time you will need to adapt this timezone twice a year).
It would be interesting to have functions that converts a time/date to a locale time/date string like the javascript Date methods: