Add system:tz()

This commit is contained in:
Evgeny
2025-05-05 08:35:59 +08:00
parent d7cd1c7f26
commit 26ebaa3020
2 changed files with 8 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ The type of script is determined by the line (meta tag) at the beginning of the
### 5.7.1
* Added `tags` field to the app table
* Added `system:tz()` method
### 5.7.0
@@ -327,6 +328,7 @@ The function takes a command table of this format as a parameter:
* `system:alarm_sound(seconds)` - make alarm sound;
* `system:share_text(string)` - opens the "Share" system dialog;
* `system:lang()` - returns the language selected in the system;
* `system:tz()` - returns TimeZone string (example: Africa/Cairo);
* `system:tz_offset()` - returns TimeZone offset in seconds;
* `system:currency()` - returns default currency code based on locale;
* `system:format_date_localized(format, date)` - returns localized date string (using java formatting);

6
samples/tz-sample.lua Normal file
View File

@@ -0,0 +1,6 @@
function on_load()
ui:show_lines{
"Time zone: "..system:tz(),
"Offset in seconds: "..system:tz_offset()
}
end