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
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);