diff options
author | K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com> | 2019-03-29 06:53:11 -0700 |
---|---|---|
committer | K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com> | 2019-07-01 13:39:21 -0700 |
commit | 05de0eafabc4238d79fac285c5639e5556e67d98 (patch) | |
tree | c9a788db1616dbf6cd3cc1af192adbcb7e3f54c4 /core | |
parent | e2bbf2cba3dc97998cff0be5cbda2d7e3b7151b0 (diff) | |
download | redot-engine-05de0eafabc4238d79fac285c5639e5556e67d98.tar.gz |
Add editor screenshot on control - f12.
Diffstat (limited to 'core')
-rw-r--r-- | core/os/os.cpp | 29 | ||||
-rw-r--r-- | core/os/os.h | 1 |
2 files changed, 30 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; } diff --git a/core/os/os.h b/core/os/os.h index 1b19ddff26..2224d3b006 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -336,6 +336,7 @@ public: virtual Date get_date(bool local = false) const = 0; virtual Time get_time(bool local = false) const = 0; virtual TimeZoneInfo get_time_zone_info() const = 0; + virtual String get_iso_date_time(bool local = false) const; virtual uint64_t get_unix_time() const; virtual uint64_t get_system_time_secs() const; virtual uint64_t get_system_time_msecs() const; |