Scarab
v2.4.4
Project 8 C++ Utility Library
library
utility
time.cc
Go to the documentation of this file.
1
/*
2
* time.cc
3
*
4
* Created on: Oct 29, 2013
5
* Author: nsoblath
6
*/
7
8
9
#define SCARAB_API_EXPORTS
10
11
#include "
time.hh
"
12
13
#include "
date.h
"
14
15
namespace
scarab
16
{
17
18
// Combined date & time, according to the ISO 8601 standard: e.g. 2015-01-31T22:35:58Z
19
SCARAB_API
char
date_time_format
[] =
"%Y-%m-%dT%H:%M:%SZ"
;
20
21
SCARAB_API
std::string
get_formatted_now
()
22
{
23
using namespace
std::chrono;
24
return
date::format
(
scarab::date_time_format
, time_point_cast<microseconds>(system_clock::now()));
25
}
26
27
}
/* namespace scarab */
SCARAB_API
#define SCARAB_API
Definition:
scarab_api.hh:24
date::format
auto format(const std::locale &loc, const CharT *fmt, const Streamable &tp) -> decltype(to_stream(std::declval< std::basic_ostream< CharT > &>(), fmt, tp), std::basic_string< CharT >
Definition:
date.h:5663
scarab
Definition:
authentication.cc:18
scarab::get_formatted_now
std::string get_formatted_now()
Definition:
time.cc:21
date.h
time.hh
scarab::date_time_format
char date_time_format[]
Definition:
time.cc:19
Generated by
1.8.13