Files
cppdraft_translate/cppdraft/time/zone/zonedtraits.md
2025-10-25 03:02:53 +03:00

42 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[time.zone.zonedtraits]
# 30 Time library [[time]](./#time)
## 30.11 Time zones [[time.zone]](time.zone#zonedtraits)
### 30.11.6 Class template zoned_traits [time.zone.zonedtraits]
namespace std::chrono {template<class T> struct zoned_traits {};}
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9569)
zoned_traits provides a means for customizing
the behavior of zoned_time<Duration, TimeZonePtr> for the zoned_time default constructor,
and constructors taking string_view[.](#1.sentence-1)
A specialization for const time_zone* is provided by the implementation:namespace std::chrono {template<> struct zoned_traits<const time_zone*> {static const time_zone* default_zone(); static const time_zone* locate_zone(string_view name); };}
[🔗](#lib:default_zone,zoned_traits%3cconst_time_zone*%3e)
`static const time_zone* default_zone();
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9590)
*Returns*: std::chrono::locate_zone("UTC")[.](#2.sentence-1)
[🔗](#lib:locate_zone,zoned_traits%3cconst_time_zone*%3e)
`static const time_zone* locate_zone(string_view name);
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9601)
*Returns*: std::chrono::locate_zone(name)[.](#3.sentence-1)