diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibC/time.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibCore/DateTime.cpp | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/Userland/Libraries/LibC/time.cpp b/Userland/Libraries/LibC/time.cpp index a2a7b4eee8..ca26880527 100644 --- a/Userland/Libraries/LibC/time.cpp +++ b/Userland/Libraries/LibC/time.cpp @@ -270,13 +270,13 @@ size_t strftime(char* destination, size_t max_size, char const* format, const st builder.append('\n'); break; case 'p': - builder.append(tm->tm_hour < 12 ? "a.m." : "p.m."); + builder.append(tm->tm_hour < 12 ? "AM" : "PM"); break; case 'r': { int display_hour = tm->tm_hour % 12; if (display_hour == 0) display_hour = 12; - builder.appendff("{:02}:{:02}:{:02} {}", display_hour, tm->tm_min, tm->tm_sec, tm->tm_hour < 12 ? "a.m." : "p.m."); + builder.appendff("{:02}:{:02}:{:02} {}", display_hour, tm->tm_min, tm->tm_sec, tm->tm_hour < 12 ? "AM" : "PM"); break; } case 'R': diff --git a/Userland/Libraries/LibCore/DateTime.cpp b/Userland/Libraries/LibCore/DateTime.cpp index 479c433dfa..0f3530f375 100644 --- a/Userland/Libraries/LibCore/DateTime.cpp +++ b/Userland/Libraries/LibCore/DateTime.cpp @@ -173,13 +173,13 @@ String DateTime::to_string(StringView format) const builder.append('\n'); break; case 'p': - builder.append(tm.tm_hour < 12 ? "a.m." : "p.m."); + builder.append(tm.tm_hour < 12 ? "AM" : "PM"); break; case 'r': { int display_hour = tm.tm_hour % 12; if (display_hour == 0) display_hour = 12; - builder.appendff("{:02}:{:02}:{:02} {}", display_hour, tm.tm_min, tm.tm_sec, tm.tm_hour < 12 ? "a.m." : "p.m."); + builder.appendff("{:02}:{:02}:{:02} {}", display_hour, tm.tm_min, tm.tm_sec, tm.tm_hour < 12 ? "AM" : "PM"); break; } case 'R': @@ -427,19 +427,19 @@ Optional<DateTime> DateTime::parse(StringView format, String const& string) } break; case 'p': { - auto ampm = string.substring_view(string_pos, 4); - if (ampm == "p.m." && tm.tm_hour < 12) { + auto ampm = string.substring_view(string_pos, 2); + if (ampm == "PM" && tm.tm_hour < 12) { tm.tm_hour += 12; } - string_pos += 4; + string_pos += 2; break; } case 'r': { - auto ampm = string.substring_view(string_pos, 4); - if (ampm == "p.m." && tm.tm_hour < 12) { + auto ampm = string.substring_view(string_pos, 2); + if (ampm == "PM" && tm.tm_hour < 12) { tm.tm_hour += 12; } - string_pos += 4; + string_pos += 2; break; } case 'R': { |