sparrow 0.3.0
Loading...
Searching...
No Matches
timestamp_example.cpp
Go to the documentation of this file.
1
5
6#include <cassert>
7
9
10int main()
11{
13 constexpr uint64_t epoch = 1737639900; // Thursday January 23, 2025 08:45:00
14 const date::time_zone* new_york = date::locate_zone("America/New_York");
15 const date::time_zone* paris = date::locate_zone("Europe/Paris");
16 std::vector<sparrow::timestamp<std::chrono::seconds>> input_values;
17 input_values.emplace_back(new_york, date::sys_time<std::chrono::seconds>{std::chrono::seconds(epoch)});
19 assert(ar.size() == 1);
20 assert(ar[0].has_value());
21 assert(ar[0].value().get_sys_time().time_since_epoch().count() == epoch);
23 return EXIT_SUCCESS;
24}
int main()