ceylon-sdk icon indicating copy to clipboard operation
ceylon-sdk copied to clipboard

Use native implementation to get current time zone name and offset

Open luolong opened this issue 10 years ago • 6 comments

Now that Ceylon has full support for native implementations, we can make use of native JVM and/or Javascript to get current time zone name and offset information from current platform.

luolong avatar Oct 08 '15 08:10 luolong

Moving to 1.3

FroMage avatar Oct 12 '15 14:10 FroMage

For offset we already do indirectly, currently we use system.timezoneOffset in our timeZone.system, or do you mean remove it from system ? For name we dont have anything, but it possible to do like we do for offset.. I would like to do this issue, can you guide me @luolong about my doubts?

DiegoCoronel avatar Oct 12 '15 16:10 DiegoCoronel

Yes, we currently use native information from system.timzoneOffset which falls back to native implementation.

This was initially done so simply because there was no proper way to have native implementations for other modules than ceylon.language.

Now that Ceylon 1.2 has full support for native implementations, we should not hesitate to use it.

luolong avatar Oct 15 '15 14:10 luolong

But I don't understand what the advantage would be. It's the same, no?

gavinking avatar Oct 15 '15 14:10 gavinking

well, for offset, we could keep using it -- no problems there

But we need more information like name of the current time zone for example, when we have fully functional rule based time zones...

luolong avatar Oct 15 '15 14:10 luolong

OK but I would be perfectly happy adding that to the language module too.

gavinking avatar Oct 15 '15 14:10 gavinking