1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:37:35 +00:00

LibCore: Add format option for DateTime::to_string() (#1358)

This commit is contained in:
howar6hill 2020-03-08 18:35:26 +08:00 committed by GitHub
parent b6307beb6e
commit 10e0d4a196
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 148 additions and 5 deletions

View file

@ -26,7 +26,7 @@
#pragma once
#include <AK/Forward.h>
#include <AK/String.h>
#include <time.h>
namespace Core {
@ -43,7 +43,7 @@ public:
unsigned minute() const { return m_minute; }
unsigned second() const { return m_second; }
String to_string() const;
String to_string(const String& format = "%Y-%m-%d %H:%M:%S") const;
static DateTime now();
static DateTime from_timestamp(time_t);