summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibCore/DateTime.cpp3
-rw-r--r--Userland/Libraries/LibCore/DateTime.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCore/DateTime.cpp b/Userland/Libraries/LibCore/DateTime.cpp
index 490a27d2f6..dce43d57b5 100644
--- a/Userland/Libraries/LibCore/DateTime.cpp
+++ b/Userland/Libraries/LibCore/DateTime.cpp
@@ -246,6 +246,9 @@ String DateTime::to_string(const String& format) const
format_time_zone_offset(true);
break;
+ case 'Z':
+ builder.append(tzname[0]);
+ break;
case '%':
builder.append('%');
break;
diff --git a/Userland/Libraries/LibCore/DateTime.h b/Userland/Libraries/LibCore/DateTime.h
index 30ac5227af..628dd7e343 100644
--- a/Userland/Libraries/LibCore/DateTime.h
+++ b/Userland/Libraries/LibCore/DateTime.h
@@ -30,7 +30,7 @@ public:
bool is_leap_year() const;
void set_time(int year, int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0);
- String to_string(const String& format = "%Y-%m-%d %H:%M:%S") const;
+ String to_string(const String& format = "%Y-%m-%d %H:%M:%S %Z") const;
static DateTime create(int year, int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0);
static DateTime now();