moroznastya faf9f5de6a parsing promos | 11 months ago | |
---|---|---|
.. | ||
ut | faf9f5de6a parsing promos | 11 months ago |
CMakeLists.darwin-arm64.txt | ffff7a34e4 add darwin-arm64 CMakeLists | 1 year ago |
CMakeLists.darwin-x86_64.txt | c76aaf823d Fix input variable missprint | 1 year ago |
CMakeLists.linux-aarch64.txt | c76aaf823d Fix input variable missprint | 1 year ago |
CMakeLists.linux-x86_64.txt | c76aaf823d Fix input variable missprint | 1 year ago |
CMakeLists.txt | 96458ea3c7 External build system generator release 65 | 11 months ago |
CMakeLists.windows-x86_64.txt | c76aaf823d Fix input variable missprint | 1 year ago |
README.md | 59aca5c518 Restoring authorship annotation for Ivan Komarov <Ivan.Komarov@dfyz.info>. Commit 2 of 2. | 2 years ago |
civil-inl.h | b3c1a08629 Restoring authorship annotation for <gotmanov@yandex-team.ru>. Commit 2 of 2. | 2 years ago |
civil.cpp | faf9f5de6a parsing promos | 11 months ago |
civil.h | faf9f5de6a parsing promos | 11 months ago |
convert.cpp | 1fe4b402b3 Restoring authorship annotation for <petrk@yandex-team.ru>. Commit 2 of 2. | 2 years ago |
convert.h | 1fe4b402b3 Restoring authorship annotation for <petrk@yandex-team.ru>. Commit 2 of 2. | 2 years ago |
ya.make | bf0f13dd39 add ymake export to ydb | 1 year ago |
A library for translating between absolute times (i.e., TInstant
) and civil times (i.e.,
NDatetime::TSimpleTM
) using the rules defined by a time zone (i.e., NDatetime::TTimeZone
).
(the terms absolute
and civil
come from cctz#fundamental-concepts)
This is basically a wrapper around CCTZ with one important change: the time zone database is in Arcadia and is compiled with the library (which means your executable will end up ~2MB larger).
See contrib/libs/cctz/README if you think zone database is outdated.
#include <library/cpp/timezone_conversion/convert.h>
// NDatetime::{GetLocalTimeZone(),GetUtcTimeZone()} are also available.
NDatetime::TTimeZone msk = NDatetime::GetTimeZone("Europe/Moscow");
TInstant now = TInstant::Now();
NDatetime::TSimpleTM civil = NDatetime::ToCivilTime(now, msk);
Cout << "Local time in Moscow is " << civil.ToString() << Endl;
TInstant absolute = NDatetime::ToAbsoluteTime(civil, msk);
Cout << "The current UNIX time is " << absolute.Seconds() << Endl;