#ifndef DATE_UTIL_H
#define DATE_UTIL_H
#include <chrono>
#include <string>

#define Ymd_ "%F"
#define Ymd "%Y%m%d"
#define HMS_ "%T"
#define HMS "%H%M%S"
#define YmdHMS_ "%F %T"
#define YmdHMS "%Y%m%d%H%M%S"

namespace zsy
{
    class DateUtil
    {
    public:
        using TimePoint = std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds>;

        static std::string format(const std::string &pattern = YmdHMS_, TimePoint dt = std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::system_clock::now()));

        static long long timestamp();
    };
} // zsy

#endif //DATE_UTIL_H
