Enigma 3.2.2
A Simple, Reliable and Efficient Encryption Tool
Loading...
Searching...
No Matches
DateTimeUtils.hpp File Reference
#include <ctime>
#include <iomanip>
#include <sstream>
#include <string>

Go to the source code of this file.

Namespaces

namespace  Enigma
 
namespace  Enigma::DateTimeUtils
 Namespace contains useful Date Time related utility functions.
 

Functions

static std::string Enigma::DateTimeUtils::toString (const std::time_t &time, const std::string_view &format="%Y-%m-%d %H:%M:%S")
 Converts an std::time_t to a string date time with a specific format.
 
static std::time_t Enigma::DateTimeUtils::fromString (const std::string &dateTimeStr, const std::string_view &format="%Y-%m-%d %H:%M:%S")
 Converts a string date time with a specific format to an std::time_t.
 
static std::string Enigma::DateTimeUtils::now (const std::string_view &format="%Y-%m-%d %H:%M:%S")
 returns current date and time as a string with a specific format