[time.clock.file] # 30 Time library [[time]](./#time) ## 30.7 Clocks [[time.clock]](time.clock#file) ### 30.7.6 Type file_clock [time.clock.file] #### [30.7.6.1](#overview) Overview [[time.clock.file.overview]](time.clock.file.overview) namespace std::chrono {using file_clock = *see below*;} [1](#overview-1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L3369) file_clock is an alias for a type meeting the [*Cpp17TrivialClock*](time.clock.req#:Cpp17TrivialClock "30.3 Cpp17Clock requirements [time.clock.req]") requirements ([[time.clock.req]](time.clock.req "30.3 Cpp17Clock requirements")), and using a signed arithmetic type for file_clock​::​rep[.](#overview-1.sentence-1) file_clock is used to create the time_point system used for file_time_type ([[filesystems]](filesystems "31.12 File systems"))[.](#overview-1.sentence-2) Its epoch is unspecified, andnoexcept(file_clock​::​now()) is true[.](#overview-1.sentence-3) [*Note [1](#overview-note-1)*: The type that file_clock denotes can be in a different namespace than std​::​chrono, such as std​::​filesystem[.](#overview-1.sentence-4) — *end note*] #### [30.7.6.2](#members) Member functions [[time.clock.file.members]](time.clock.file.members) [1](#members-1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L3386) The type denoted by file_clock provides precisely one of the following two sets of static member functions:templatestatic sys_time<*see below*> to_sys(const file_time&);templatestatic file_time<*see below*> from_sys(const sys_time&); or:templatestatic utc_time<*see below*> to_utc(const file_time&);templatestatic file_time<*see below*> from_utc(const utc_time&); These member functions shall provide time_point conversions consistent with those specified byutc_clock, tai_clock, and gps_clock[.](#members-1.sentence-2) The Duration of the resultant time_point is computed from the Duration of the input time_point[.](#members-1.sentence-3) #### [30.7.6.3](#nonmembers) Non-member functions [[time.clock.file.nonmembers]](time.clock.file.nonmembers) [🔗](#lib:operator%3c%3c,file_time) `template basic_ostream& operator<<(basic_ostream& os, const file_time& t); ` [1](#nonmembers-1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L3423) *Effects*: Equivalent to:return os << format(os.getloc(), *STATICALLY-WIDEN*("{:L%F %T}"), t); [🔗](#lib:from_stream,file_time) `template> basic_istream& from_stream(basic_istream& is, const charT* fmt, file_time& tp, basic_string* abbrev = nullptr, minutes* offset = nullptr); ` [2](#nonmembers-2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L3441) *Effects*: Attempts to parse the input stream is into the file_time tp using the format flags given in the NTCTS fmt as specified in [[time.parse]](time.parse "30.13 Parsing")[.](#nonmembers-2.sentence-1) If the parse fails to decode a valid date,is.setstate(ios_base​::​failbit) is called andtp is not modified[.](#nonmembers-2.sentence-2) If %Z is used and successfully parsed, that value will be assigned to *abbrev if abbrev is non-null[.](#nonmembers-2.sentence-3) If %z (or a modified variant) is used and successfully parsed, that value will be assigned to *offset if offset is non-null[.](#nonmembers-2.sentence-4) Additionally, the parsed offset will be subtracted from the successfully parsed timestamp prior to assigning that difference to tp[.](#nonmembers-2.sentence-5) [3](#nonmembers-3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L3457) *Returns*: is[.](#nonmembers-3.sentence-1)