summaryrefslogtreecommitdiff
path: root/core/os/os.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-07-02 11:30:16 +0200
committerGitHub <noreply@github.com>2019-07-02 11:30:16 +0200
commit98879be2766de1ec54bb3478e09538289ca66370 (patch)
tree06388835e13c4f2310e092f563c1572136ca5a0d /core/os/os.cpp
parentc486b8dac04edfe2d35f1ee0bc0b3b410f4175ae (diff)
parent05de0eafabc4238d79fac285c5639e5556e67d98 (diff)
Merge pull request #27510 from fire/screenshot_editor
Add editor screenshot on control - f12.
Diffstat (limited to 'core/os/os.cpp')
-rw-r--r--core/os/os.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 08067385ab..925154af7d 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -51,6 +51,35 @@ uint32_t OS::get_ticks_msec() const {
return get_ticks_usec() / 1000;
}
+String OS::get_iso_date_time(bool local) const {
+ OS::Date date = get_date(local);
+ OS::Time time = get_time(local);
+
+ String timezone;
+ if (!local) {
+ TimeZoneInfo zone = get_time_zone_info();
+ if (zone.bias >= 0) {
+ timezone = "+";
+ }
+ timezone = timezone + itos(zone.bias / 60).pad_zeros(2) + itos(zone.bias % 60).pad_zeros(2);
+ } else {
+ timezone = "Z";
+ }
+
+ return itos(date.year).pad_zeros(2) +
+ "-" +
+ itos(date.month).pad_zeros(2) +
+ "-" +
+ itos(date.day).pad_zeros(2) +
+ "T" +
+ itos(time.hour).pad_zeros(2) +
+ ":" +
+ itos(time.min).pad_zeros(2) +
+ ":" +
+ itos(time.sec).pad_zeros(2) +
+ timezone;
+}
+
uint64_t OS::get_splash_tick_msec() const {
return _msec_splash;
}