mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-03 04:34:26 +02:00
Updated Examples and Recipes (markdown)
@@ -108,12 +108,12 @@ Let's say you want to find out how many hours ahead Sydney is from LA (now). Fi
|
|||||||
|
|
||||||
17:00:00.000000
|
17:00:00.000000
|
||||||
|
|
||||||
Because we did not specify otherwise, the default behavior is to give us the full precision of `system_clock::time_point`. If you would prefer other behavior (e.g. minutes precision), that is easily accomplished with just a little more work. `using` directives make the code a little more readable:
|
Because we did not specify otherwise, the default behavior is to give us the full precision of `system_clock::time_point`. If you would prefer other behavior (e.g. minutes precision), that is easily accomplished with just a little more work:
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
using namespace date;
|
using namespace date;
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
std::cout << make_time(floor<minutes>(sy.get_local_time() - la.get_local_time())) << '\n';
|
std::cout << date::format("%H:%M\n", sy.get_local_time() - la.get_local_time());
|
||||||
```
|
```
|
||||||
|
|
||||||
And now the output is:
|
And now the output is:
|
||||||
|
Reference in New Issue
Block a user