diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-13 11:01:12 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-13 11:01:12 +0200 |
commit | ff824b6f9d5bfa021ff788731a7e135afc95accd (patch) | |
tree | dc5a0174dfe884a8102ddb4c5785fc04be24783e /platform/linuxbsd/os_linuxbsd.cpp | |
parent | 3a82a1315b31221507808a540d8657af835f27ca (diff) | |
parent | 0aecfc92540618508568b5c7e8a050d36cf5322b (diff) | |
download | redot-engine-ff824b6f9d5bfa021ff788731a7e135afc95accd.tar.gz |
Merge pull request #65509 from gotnospirit/master-os-get_datetime
get_datetime_* functions can return wrong values
Diffstat (limited to 'platform/linuxbsd/os_linuxbsd.cpp')
-rw-r--r-- | platform/linuxbsd/os_linuxbsd.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp index 61faf3061c..f0d7b6ede5 100644 --- a/platform/linuxbsd/os_linuxbsd.cpp +++ b/platform/linuxbsd/os_linuxbsd.cpp @@ -686,10 +686,9 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) { String renamed_path = path.get_base_dir() + "/" + file_name; // Generates the .trashinfo file - OS::Date date = OS::get_singleton()->get_date(false); - OS::Time time = OS::get_singleton()->get_time(false); - String timestamp = vformat("%04d-%02d-%02dT%02d:%02d:", date.year, (int)date.month, date.day, time.hour, time.minute); - timestamp = vformat("%s%02d", timestamp, time.second); // vformat only supports up to 6 arguments. + OS::DateTime dt = OS::get_singleton()->get_datetime(false); + String timestamp = vformat("%04d-%02d-%02dT%02d:%02d:", dt.year, (int)dt.month, dt.day, dt.hour, dt.minute); + timestamp = vformat("%s%02d", timestamp, dt.second); // vformat only supports up to 6 arguments. String trash_info = "[Trash Info]\nPath=" + path.uri_encode() + "\nDeletionDate=" + timestamp + "\n"; { Error err; |