1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

date: Display time zone information in all output formats

This commit is contained in:
Timothy Flynn 2022-01-25 16:09:51 -05:00 committed by Linus Groh
parent 29c8ec5eb6
commit 82509ca0c8

View file

@ -56,11 +56,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (print_unix_date) {
outln("{}", date.timestamp());
} else if (print_iso_8601) {
outln("{}", date.to_string("%Y-%m-%dT%H:%M:%S-00:00"));
outln("{}", date.to_string("%Y-%m-%dT%H:%M:%S%:z"));
} else if (print_rfc_5322) {
outln("{}", date.to_string("%a, %d %b %Y %H:%M:%S -0000"));
outln("{}", date.to_string("%a, %d %b %Y %H:%M:%S %z"));
} else if (print_rfc_3339) {
outln("{}", date.to_string("%Y-%m-%d %H:%M:%S-00:00"));
outln("{}", date.to_string("%Y-%m-%d %H:%M:%S%:z"));
} else {
outln("{}", date.to_string());
}