aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/timezone_conversion/convert.h
diff options
context:
space:
mode:
authorIvan Komarov <Ivan.Komarov@dfyz.info>2022-02-10 16:46:48 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:48 +0300
commit4de97ab2fe437cbe83e4c63234e809ddd5ac34f2 (patch)
treeff8fb38b661955e6c99d1d000d6c72f739199590 /library/cpp/timezone_conversion/convert.h
parent9abfb1a53b7f7b791444d1378e645d8fad9b06ed (diff)
downloadydb-4de97ab2fe437cbe83e4c63234e809ddd5ac34f2.tar.gz
Restoring authorship annotation for Ivan Komarov <Ivan.Komarov@dfyz.info>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/timezone_conversion/convert.h')
-rw-r--r--library/cpp/timezone_conversion/convert.h88
1 files changed, 44 insertions, 44 deletions
diff --git a/library/cpp/timezone_conversion/convert.h b/library/cpp/timezone_conversion/convert.h
index 768a9e110f..404650817c 100644
--- a/library/cpp/timezone_conversion/convert.h
+++ b/library/cpp/timezone_conversion/convert.h
@@ -1,36 +1,36 @@
-#pragma once
-
+#pragma once
+
#include "civil.h"
#include <contrib/libs/cctz/include/cctz/time_zone.h>
-#include <util/datetime/base.h>
-#include <util/draft/datetime.h>
-
-namespace NDatetime {
- /**
- * @return The mother of all time zones.
- * @see https://en.wikipedia.org/wiki/Coordinated_Universal_Time
- */
- TTimeZone GetUtcTimeZone();
-
- /**
- * @return The time zone that is curently set on your machine.
- */
- TTimeZone GetLocalTimeZone();
-
- /**
- * @param absoluteTime A TInstant representing a number of seconds elapsed
- * since The Epoch (the microsecond part is ignored).
- * @param tz The time zone to use for conversion.
- * @return The civil time corresponding to absoluteTime.
- * @note This conversion is always well-defined (i.e., there
- * is exactly one civil time which corresponds to
- * absoluteTime).
- * @see https://en.wikipedia.org/wiki/Unix_time
- */
- TSimpleTM ToCivilTime(const TInstant& absoluteTime, const TTimeZone& tz);
-
- /**
+#include <util/datetime/base.h>
+#include <util/draft/datetime.h>
+
+namespace NDatetime {
+ /**
+ * @return The mother of all time zones.
+ * @see https://en.wikipedia.org/wiki/Coordinated_Universal_Time
+ */
+ TTimeZone GetUtcTimeZone();
+
+ /**
+ * @return The time zone that is curently set on your machine.
+ */
+ TTimeZone GetLocalTimeZone();
+
+ /**
+ * @param absoluteTime A TInstant representing a number of seconds elapsed
+ * since The Epoch (the microsecond part is ignored).
+ * @param tz The time zone to use for conversion.
+ * @return The civil time corresponding to absoluteTime.
+ * @note This conversion is always well-defined (i.e., there
+ * is exactly one civil time which corresponds to
+ * absoluteTime).
+ * @see https://en.wikipedia.org/wiki/Unix_time
+ */
+ TSimpleTM ToCivilTime(const TInstant& absoluteTime, const TTimeZone& tz);
+
+ /**
* Creates civil time in place with respect of given timezone.
* @param[in] tz The time zone to use for creation.
* @param[in] year The year of the creation time.
@@ -44,17 +44,17 @@ namespace NDatetime {
TSimpleTM CreateCivilTime(const TTimeZone& tz, ui32 year, ui32 mon, ui32 day, ui32 h = 0, ui32 m = 0, ui32 s = 0);
/**
- * @param civilTime A human-readable date and time (the following fields
- * are used by this function: {Year,Mon,MDay,Hour,Min,Sec}).
- * @param tz The time zone to use for conversion.
- * @return Some absolute time corresponding to civilTime.
- * @note If multiple absolute times match civilTime, the earliest
- * if returned.
- * If civilTime doesn't exist due to discontinuity in time
- * (e.g., DST happened) we pretend the discontinuity isn't
- * there (i.e., if we skipped from 1:59AM to 3:00AM then
- * ToAbsoluteTime(2:30AM) == ToAbsoluteTime(3:30AM)).
- * @see https://en.wikipedia.org/wiki/Daylight_saving_time
- */
- TInstant ToAbsoluteTime(const TSimpleTM& civilTime, const TTimeZone& tz);
-}
+ * @param civilTime A human-readable date and time (the following fields
+ * are used by this function: {Year,Mon,MDay,Hour,Min,Sec}).
+ * @param tz The time zone to use for conversion.
+ * @return Some absolute time corresponding to civilTime.
+ * @note If multiple absolute times match civilTime, the earliest
+ * if returned.
+ * If civilTime doesn't exist due to discontinuity in time
+ * (e.g., DST happened) we pretend the discontinuity isn't
+ * there (i.e., if we skipped from 1:59AM to 3:00AM then
+ * ToAbsoluteTime(2:30AM) == ToAbsoluteTime(3:30AM)).
+ * @see https://en.wikipedia.org/wiki/Daylight_saving_time
+ */
+ TInstant ToAbsoluteTime(const TSimpleTM& civilTime, const TTimeZone& tz);
+}