{"id":303643,"date":"2020-05-15T09:00:20","date_gmt":"2020-05-15T09:00:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=303643"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=303643","title":{"rendered":"\u0421\u043a\u0430\u0437\u043a\u0430 \u043e \u043b\u0438\u0448\u043d\u0435\u043c \u0438 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041f\u043e \u0432\u0435\u0440\u0441\u0438\u0438 py3"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/502088\/\">\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0434\u0435\u043b\u044c \u043d\u0430\u0437\u0430\u0434 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <code>TZ<\/code>. \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430\u0440\u0443\u0448\u0438\u043b\u043e \u0445\u0440\u0443\u043f\u043a\u043e\u0435 \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u0438\u0435 \u0431\u0430\u0433\u043e\u0432 \u0432\u043e \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 RPS \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0432 \u043d\u0430\u0448\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u0442\u0435 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0448\u043b\u0438 \u0441 \u0443\u043c\u0430. \u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0433\u043e\u043d\u044f\u043b\u0441\u044f \u0437\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0447\u0430\u0441\u0430\u043c\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u043d\u0435\u0439. <\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"s-chego-vsyo-nachalos\">\u0421 \u0447\u0435\u0433\u043e \u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c<\/h2>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u0440\u0443\u043a\u0430\u043c\u0438 \u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0438\u0437 cron.d. \u041f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u043e\u0432 \u043f\u0440\u044f\u043c\u044b\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u043e, \u0447\u0442\u043e \u0436\u0435 \u043d\u0435 \u0442\u0430\u043a.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\"># \u0423\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 $ TZ='' clickhouse-client; echo exit=$? ClickHouse client version 20.3.2.1. Connecting to localhost:9000 as user default. Connected to ClickHouse server version 20.3.2 revision 54433. Poco::Exception. Code: 1000, e.code() = 0, e.displayText() = Exception: Could not determine time zone from TZ variable value: '': filesystem error: in file_size: Is a directory [\/usr\/share\/zoneinfo] (version 20.3.2.1) exit=232<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"oshibka-u-nas-ili-v-programme\">\u041e\u0448\u0438\u0431\u043a\u0430 \u0443 \u043d\u0430\u0441 \u0438\u043b\u0438 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435?<\/h3>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u043d\u043e \u043b\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u043b\u0438 \u044d\u0442\u043e \u0431\u0430\u0433?<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/www.gnu.org\/software\/libc\/manual\/html_node\/TZ-Variable.html\" rel=\"nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f GNU<\/a> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0441\u0442\u044c 3 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <code>TZ<\/code>:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0424\u043e\u0440\u043c\u0430\u0442 \u0431\u0435\u0437 DST (\u043b\u0435\u0442\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438): <code>std offset<\/code>. \u041f\u0440\u0438\u043c\u0435\u0440\u044b: <code>EST+5<\/code>, <code>GMT+0<\/code><\/li>\n<li>\u0424\u043e\u0440\u043c\u0430\u0442 \u0441 DST: <code>std offset dst [offset],start[\/time],end[\/time]<\/code>. \u041f\u0440\u0438\u043c\u0435\u0440: <code>EST+5EDT,M3.2.0\/2,M11.1.0\/2<\/code>.<\/li>\n<li>\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430. \u041c\u043e\u0436\u0435\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u044f <code>:<\/code>. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0432\u044b\u0439 (\u0438\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435\u043c) \u0441\u0438\u043c\u0432\u043e\u043b \u044d\u0442\u043e \u0441\u043b\u044d\u0448 <code>\/<\/code>, \u0442\u043e \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043e \u0444\u0430\u0439\u043b\u0430. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e <code>\/usr\/share\/zoneinfo\/${TZ}<\/code>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0417\u0430\u0447\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 ClickHouse \u0437\u043d\u0430\u043d\u0438\u044f \u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438?<\/p>\n<p>  <\/p>\n<p>\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 <code>Date<\/code> \u0438 <code>DateTime<\/code> \u0432 DBMS \u044d\u0442\u043e timestamp, \u0438 \u043f\u0440\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 <code>toDateTime('2020-02-02 20:20:20')<\/code> \u043a\u043b\u0438\u0435\u043d\u0442 (\u0438\u043b\u0438, \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0441\u0435\u0440\u0432\u0435\u0440) \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u044d\u0442\u043e \u0432 <code>UInt32<\/code>. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0437\u043d\u0430\u043d\u0438\u044f \u043e \u0447\u0430\u0441\u043e\u0432\u043e\u043c \u043f\u043e\u044f\u0441\u0435. \u0418 \u044f\u0432\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <code>TZ<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439, \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u0432\u0435\u0441\u043a\u0443\u044e \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u0443\u044e \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0432\u043c\u0435\u0441\u0442\u043e 98% \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0430\u0442\u043e\u0439 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c.<\/p>\n<p>  <\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 ClickHouse (\u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432 \u043d\u0451\u043c Poco) \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442, \u043d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0438 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<p>  <\/p>\n<h3 id=\"ispravlenie\">\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c, \u0430 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u043c. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430\u0448 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u0434\u043b\u044f cron.d \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u0437\u0430\u0434\u0430\u0447 \u0441 \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <code>TZ<\/code>, \u0435\u0441\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043e. \u042f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b \u043f\u0443\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u0414\u043e\u0431\u0430\u0432\u0438\u043b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434, \u0441\u043e \u0441\u0440\u0435\u0434\u044b 2020-04-15 \u043e\u043d\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u043f\u043e\u043c\u0430\u0440\u0438\u043d\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \u0442\u0435\u0441\u0442\u0438\u043d\u0433\u0435 \u0438 \u0432 \u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a 2020-04-20 \u043f\u043e\u043f\u0430\u043b\u0438 \u0432 \u043f\u0440\u043e\u0434.<\/p>\n<p>  <\/p>\n<h2 id=\"i-posledstviya-ispravleniya\">\u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0412 \u0441\u0440\u0435\u0434\u0443 2020-04-22 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043a \u0430\u0434\u043c\u0438\u043d\u0443 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0438\u0433\u0440 \u0441\u043e \u0441\u043b\u043e\u0432\u0430\u043c\u0438 (\u0432 \u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438): &quot;\u0417\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0442\u0440\u0438 \u0434\u043d\u044f \u0432 RPS \u0441\u043f\u043b\u043e\u0448\u043d\u044b\u0435 \u0432\u0437\u0434\u0440\u0436\u043d\u0438&quot; <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nr\/v0\/ps\/nrv0psltrqw_1emtfrick60lm9w.png\" alt=\"non UTC hosts\"><\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 <a href=\"https:\/\/github.com\/innogames\/igcollect\/blob\/8186876e92f244e2dc3d5c67f2e364697cf218d1\/igcollect\/logfile_values.py\" rel=\"nofollow\">\u0441\u043a\u0440\u0438\u043f\u0442<\/a>, \u0441\u0447\u0438\u0442\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u043b\u043e\u0433-\u0444\u0430\u0439\u043b\u0430\u043c, \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b. \u0410 \u0432\u043e\u0442 \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 <a href=\"https:\/\/github.com\/innogames\/igcollect\/blob\/8186876e92f244e2dc3d5c67f2e364697cf218d1\/igcollect\/logfile_values.py#L53\" rel=\"nofollow\">\u043d\u043e\u043c\u0435\u0440 \u043e\u0434\u0438\u043d<\/a> \u0438 <a href=\"https:\/\/github.com\/innogames\/igcollect\/blob\/8186876e92f244e2dc3d5c67f2e364697cf218d1\/igcollect\/logfile_values.py#L259-L260\" rel=\"nofollow\">\u043d\u043e\u043c\u0435\u0440 \u0434\u0432\u0430<\/a>.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">self.now = int(datetime.datetime.utcnow().timestamp()) ... dt = datetime.datetime.strptime(time_str, time_format).utctimetuple() timestamp = time.mktime(dt)<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"chto-delaet-datetimeutcnow\">\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 <code>datetime.utcnow()<\/code>?<\/h3>\n<p>  <\/p>\n<blockquote><p>Return the current UTC date and time, with <code>tzinfo<\/code>=<code>None<\/code>.<br \/>  This is like <code>now()<\/code>, but returns the current UTC date and time, as a <strong>naive<\/strong> <code>datetime<\/code> object. An aware current UTC datetime can be obtained by calling <code>datetime.now(timezone.utc)<\/code>. See also <code>now()<\/code>.<br \/>  <strong>Warning:<\/strong> Because naive <code>datetime<\/code> objects are treated by many <code>datetime<\/code> methods as local times, it is preferred to use aware datetimes to represent times in UTC. As such, the recommended way to create an object representing the current time in UTC is by calling <code>datetime.now(timezone.utc)<\/code>.<\/p><\/blockquote>\n<p>\u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f UTC, \u043d\u043e \u0441 <code>tzinfo=None<\/code> \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 <code>datetime<\/code>. \u041f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0437\u043e\u0432 <code>.timestamp()<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 UNIX time \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430, \u043d\u043e \u0434\u043b\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 UTC. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0435\u0440\u043d\u044b\u043c \u043b\u0438\u0448\u044c \u0432 \u043e\u0434\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435: \u0435\u0441\u043b\u0438 \u0445\u043e\u0441\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 <code>TZ=UTC<\/code><\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>datetime.now().timestamp()<\/code>. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0440\u0435\u043c\u044f, \u0431\u0435\u0437 <code>.timestamp()<\/code>, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>datetime.now(timezone.utc)<\/code><\/p>\n<p>  <\/p>\n<h3 id=\"chto-delaet-datetimeutctimetuple\">\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 <code>datetime.utctimetuple()<\/code>?<\/h3>\n<p>  <\/p>\n<blockquote><p><code>datetime.timetuple()<\/code>:<br \/>  Return <code>time.struct_time<\/code> such as returned by <code>time.localtime()<\/code>.<br \/>  <code>datetime.utctimetuple()<\/code>:<br \/>  If <code>datetime<\/code> instance <em>d<\/em> is naive, this is the same as <code>d.timetuple()<\/code> except that <code>tm_isdst<\/code> is forced to 0 regardless of what <code>d.dst()<\/code> returns. DST is never in effect for a UTC time.<br \/>  If <em>d<\/em> is aware, <em>d<\/em> is normalized to UTC time, by subtracting <code>d.utcoffset()<\/code>, and a <code>time.struct_time<\/code> for the normalized time is returned. <code>tm_isdst<\/code> is forced to 0.<br \/>  <strong>Warning:<\/strong> Because naive <code>datetime<\/code> objects are treated by many <code>datetime<\/code> methods as local times, it is preferred to use aware datetimes to represent times in UTC; as a result, using <code>utcfromtimetuple<\/code> may give misleading results. If you have a naive <code>datetime<\/code> representing UTC, use <em>datetime.replace(tzinfo=timezone.utc)<\/em> to make it aware, at which point you can use <em>datetime.timetuple()<\/em>.<\/p><\/blockquote>\n<p>\u0422\u0443\u0442 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u0435\u0435. \u041e\u0431\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 <code>time.struct_time<\/code>, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f <code>time.mktime()<\/code>. \u041c\u043e\u0451 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <a href=\"https:\/\/stackoverflow.com\/questions\/30020988\/python3-datetime-timestamp-in-python2\" rel=\"nofollow\">\u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 python2<\/a>. \u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043e\u0431\u043e\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0441 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c. \u041a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u0434\u043b\u044f UNIX timestamp \u044d\u0442\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0438\u0442\u043e\u043d\u0430.<\/p>\n<p>  <\/p>\n<p>\u0425\u0432\u0430\u043b\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443 Python, \u0443\u0436\u0435 \u0438 \u043d\u0435 \u043d\u0430\u0434\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c \u0432\u0442\u043e\u0440\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>datetime.strptime().timestamp()<\/code><\/p>\n<p>  <\/p>\n<h2 id=\"testirovanie-razlichnyh-metodov-pri-razlichnyh-znacheniyah-peremennoy-tz\">\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0440\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>TZ<\/code><\/h2>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0431\u044b\u043b\u043e \u0434\u043e\u043b\u0433\u0438\u043c \u0438 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u044b\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0448\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0435\u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u0430 \u0438 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438. \u0413\u0434\u0435-\u0442\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043e \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0443, \u0433\u0434\u0435-\u0442\u043e \u0432 UTC, \u0430 \u0433\u0434\u0435-\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043e \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0443, \u043d\u043e \u043f\u0430\u0440\u0441\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0432\u0435\u0441\u0435\u043b\u044c\u0435.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, RPS \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0438 \u0432\u043e\u0442 \u0442\u0430\u043a: <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4l\/n2\/xi\/4ln2xiawc-i_0thr9bjt4litcqg.png\" alt=\"UTC hosts\"><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0432\u0435\u0440\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <a href=\"https:\/\/github.com\/innogames\/igcollect\/pull\/137#discussion_r413653487\" rel=\"nofollow\">\u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043b\u043b\u0435\u0433\u0438<\/a>, \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u0438 \u0432\u044b\u043a\u0430\u0447\u0435\u043d\u044b \u0432 \u043f\u0440\u043e\u0434. \u0412 \u0440\u0435\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435 \u0436\u0435 \u0441\u0442\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445.<\/p>\n<p>  <\/p>\n<p>\u041a\u0435\u0439\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0448\u043b\u0438 \u043d\u0430 \u0443\u043c:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u043b\u043e\u043c\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>TZ=''<\/code><\/li>\n<li>\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 UTC \u0438 \u043e\u0442 \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f <code>strptime()<\/code><\/li>\n<li>\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430 UTC, \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f <code>strptime()<\/code><\/li>\n<li>\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430 \u0447\u0430\u0441\u043e\u0432\u044b\u043c \u043f\u043e\u044f\u0441\u043e\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f <code>strptime()<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<p><code>strptime<\/code> \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u043b\u0441\u044f \u043a \u0441\u0442\u0440\u043e\u043a\u0435 <code>2020-04-24T05:31:55+02:00<\/code><\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0442\u0435\u0441\u0442\u043e\u0432<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 python<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/env python from datetime import datetime, timezone  # noqa from time import mktime def pprint(d: dict):     for k in d:         print(&quot;{}: {}&quot;.format(k, d[k])) now = {'now': datetime.now(),        # 'now_tz': datetime.now(timezone.utc), # the same as now for timestamp        'utcnow': datetime.utcnow()} now_ts = [int(now[k].timestamp()) for k in now] now_dict = {k: [now_ts[i], now_ts[i] - now_ts[0]] for i, k in enumerate(now)} pprint(now_dict) # pprint(now) # print('Timestamps in now: {}'.format(set(now_ts))) print() ts_c = 1587699115  # the known correct value time_format = &quot;%Y-%m-%dT%H:%M:%S%z&quot; time_str = &quot;2020-04-24T05:31:55+02:00&quot; timetuples = {     'timetuple': datetime.strptime(time_str, time_format).timetuple(),     'utctimetuple': datetime.strptime(time_str, time_format).utctimetuple(), } ts = {     'timestamp': [         int(datetime.strptime(time_str, time_format).timestamp()),         int(datetime.strptime(time_str, time_format).timestamp()) - ts_c,     ],     'timetuple': [         int(mktime(timetuples['timetuple'])),         int(mktime(timetuples['timetuple'])) - ts_c,     ],     'utctimetuple': [         int(mktime(timetuples['utctimetuple'])),         int(mktime(timetuples['utctimetuple'])) - ts_c,     ], } pprint(ts) # pprint(timetuples) # print('Timestamps in ts: {}'.format(set(int(v[0]) for v in ts.values())))<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 python \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 <code>TZ<\/code><\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/usr\/bin\/env bash for tz in '' Europe\/Moscow UTC Europe\/Berlin do   date &quot;+==TZ=${tz} %s==&quot;   TZ=$tz python example.py   date '+++%s++' -d '2020-04-24T05:31:55+02:00' done<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h3 id=\"svodnye-rezultaty\">\u0421\u0432\u043e\u0434\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h3>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0440\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 <code>TZ<\/code>. \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u043f\u043e\u044f\u0441 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0440\u0430\u0432\u0435\u043d <code>+02:00<\/code>.<\/p>\n<p>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<thead>\n<tr>\n<th>\u043c\u0435\u0442\u043e\u0434 \\ \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>TZ<\/code><\/th>\n<th>&#187;<\/th>\n<th>+03:00<\/th>\n<th>UTC<\/th>\n<th>+02:00<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>now()\/now(tz)<\/td>\n<td>+<\/td>\n<td>+<\/td>\n<td>+<\/td>\n<td>+<\/td>\n<\/tr>\n<tr>\n<td>utcnow()<\/td>\n<td>+<\/td>\n<td>&#8212;<\/td>\n<td>+<\/td>\n<td>&#8212;<\/td>\n<\/tr>\n<tr>\n<td>timestamp()<\/td>\n<td>+<\/td>\n<td>+<\/td>\n<td>+<\/td>\n<td>+<\/td>\n<\/tr>\n<tr>\n<td>timetuple()+mktime()<\/td>\n<td>&#8212;<\/td>\n<td>&#8212;<\/td>\n<td>&#8212;<\/td>\n<td>+<\/td>\n<\/tr>\n<tr>\n<td>utctimetuple()+mktime()<\/td>\n<td>+<\/td>\n<td>&#8212;<\/td>\n<td>+<\/td>\n<td>&#8212;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  <\/p>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e <code>now<\/code> \u0438 <code>timestamp<\/code> \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a, \u0431\u0443\u0434\u0442\u043e <code>timetuple + mktime<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0439\u043d\u0435 \u043e\u043f\u0430\u0441\u043d\u043e.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441 \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439 timestamp \u0438 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<h4 id=\"slomannoe-znachenie-chasovogo-poyasa-znachenie-tz\">\u0421\u043b\u043e\u043c\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>TZ=''<\/code><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">==TZ='' 1587914590== now: [1587914590, 0] utcnow: [1587914590, 0] timestamp: [1587699115, 0] timetuple: [1587706315, 7200] - TZ - UTC utctimetuple: [1587699115, 0] ++1587699115++<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"tz0300-otlichaetsya-ot-utc-i-ot-chasovogo-poyasa-stroki-dlya-strptime\"><code>TZ='+03:00'<\/code>, \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 UTC \u0438 \u043e\u0442 \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f <code>strptime()<\/code><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">==TZ=Europe\/Moscow 1587914590== now: [1587914590, 0] utcnow: [1587903790, -10800] - UTC - TZ timestamp: [1587699115, 0] timetuple: [1587695515, -3600] - +02:00 - TZ utctimetuple: [1587688315, -10800] - UTC - TZ ++1587699115++<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"tzutc-otlichaetsya-ot-chasovogo-poyasa-stroki-dlya-strptime\"><code>TZ=UTC<\/code>, \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0447\u0430\u0441\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f <code>strptime()<\/code><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">==TZ=UTC 1587914590== now: [1587914590, 0] utcnow: [1587914590, 0] timestamp: [1587699115, 0] timetuple: [1587706315, 7200] - +02:00 - UTC utctimetuple: [1587699115, 0] ++1587699115++<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"tz0200-sovpadaet-s-chasovym-poyasom-stroki-dlya-strptime\"><code>TZ='+02:00'<\/code>, \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0447\u0430\u0441\u043e\u0432\u044b\u043c \u043f\u043e\u044f\u0441\u043e\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f <code>strptime()<\/code><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">==TZ=Europe\/Berlin 1587914590== now: [1587914590, 0] utcnow: [1587907390, -7200] - UTC - TZ timestamp: [1587699115, 0] timetuple: [1587699115, 0] utctimetuple: [1587695515, -3600] - UTC - TZ... \u043d\u043e \u0431\u0435\u0437 \u0443\u0447\u0451\u0442\u0430 DST! ++1587699115++<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u043b\u0438\u0448\u0438\u043b \u043c\u0435\u043d\u044f \u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 \u0432\u0435\u0440\u044b \u0432 \u0442\u043e, \u0447\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0445\u043e\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c.<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0417\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0422\u0438\u043a\u043a\u0438 \u0428\u0435\u043b\u044c\u0435\u043d <a href=\"http:\/\/rowan.hole.ru\/music\/mp3\/101008\/10-Narcotime.mp3\" rel=\"nofollow\">\u0440\u0430\u0437\u0443\u043c\u043d\u043e \u0441\u043e\u0432\u0435\u0442\u0443\u0435\u0442<\/a>: &quot;\u041d\u0435 \u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0440\u0435\u043c\u044f \u0433\u043e\u043b\u044b\u043c\u0438 \u0440\u0443\u043a\u0430\u043c\u0438&quot;. \u0414\u043b\u044f \u043c\u0435\u043d\u044f \u0432 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0435 \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043e\u043d\u043e \u0432\u0441\u0442\u0430\u043b\u043e \u043d\u0430 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0441 DNS. \u0421\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c, \u0432 \u0446\u0435\u043b\u043e\u043c, \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0432 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0436\u0435\u043b\u0430\u044e \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u0434\u043e\u0440\u043e\u0432\u044b\u043c\u0438. \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u0441\u0438\u0434\u0435\u0442\u044c \u0434\u043e\u043c\u0430 \u0438, \u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u043e\u0447\u0435\u043d\u044c \u0441\u043a\u0443\u0447\u043d\u043e \u0438 \u043d\u0435\u0447\u0435\u043c \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f, \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0432 \u0438\u0433\u0440\u044b \u043e\u0442 <a href=\"https:\/\/innogames.com\" rel=\"nofollow\">InnoGames<\/a>. \u041a\u0441\u0442\u0430\u0442\u0438, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 <a href=\"https:\/\/www.innogames.com\/career\/\" rel=\"nofollow\">\u0432\u0430\u043a\u0430\u043d\u0441\u0438\u0438<\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/502088\/\"> https:\/\/habr.com\/ru\/post\/502088\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/502088\/\">\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0434\u0435\u043b\u044c \u043d\u0430\u0437\u0430\u0434 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <code>TZ<\/code>. \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430\u0440\u0443\u0448\u0438\u043b\u043e \u0445\u0440\u0443\u043f\u043a\u043e\u0435 \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u0438\u0435 \u0431\u0430\u0433\u043e\u0432 \u0432\u043e \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 RPS \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0432 \u043d\u0430\u0448\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u0442\u0435 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0448\u043b\u0438 \u0441 \u0443\u043c\u0430. \u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0433\u043e\u043d\u044f\u043b\u0441\u044f \u0437\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0447\u0430\u0441\u0430\u043c\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u043d\u0435\u0439. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-303643","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/303643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=303643"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/303643\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=303643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=303643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=303643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}