Add System::get_current_date_time()

This commit is contained in:
Alexander Karatarakis 2017-04-20 18:59:03 -07:00
parent 72812b7950
commit ac2007dcbd
2 changed files with 11 additions and 0 deletions

View File

@ -7,6 +7,8 @@
namespace vcpkg::System
{
tm get_current_date_time();
fs::path get_exe_path_of_current_process();
struct ExitCodeAndOutput

View File

@ -5,6 +5,15 @@
namespace vcpkg::System
{
tm get_current_date_time()
{
using std::chrono::system_clock;
std::time_t now_time = system_clock::to_time_t(system_clock::now());
tm parts;
localtime_s(&parts, &now_time);
return parts;
}
fs::path get_exe_path_of_current_process()
{
wchar_t buf[_MAX_PATH];