SlideShare a Scribd company logo
What will happen when
we stop adjusting clocks?
Maciej Harbuz
X-Coding IT Studio
Date and time in Magento
with multistore
Today, we’re going to present how
Magento handle different timezones
in different stores.
How long takes a day
● daylight
● star day
● moon day
General
General
3
1
2
1967r.
czas trwania 9 192 631 770 okresów fali świetlnej promieniowania odpowiadającego przejściu między
dwoma poziomami struktury nadsubtelnej stanu podstawowego atomu cezu 133 Cs
Leap second
23:59:59
23:59:60
00:00:00
General
360° / 24h = 15 °/h
There are 38 different time zones
UTC-09:30 UTC+05:45 UTC+14:00
General
00:00
00:00
12:00
12:00
23:59
23:59
06:33
05:33
19:20
18:20
summer
winter
Wrocław
Sevilla
08:13 20:44
Magento (1)
Magento (2)
Timezone change per website/store affects datetime in admin panel because that
isn’t saved persistent within order
Magento (3)
//convert time from UTC to admin store timezone
//we assume that all schedules in configuration (crontab.xml
and DB tables) are in admin store timezone
$time = $this->timezoneConverter->date($time)
->format('Y-m-d H:i');
Magento (4)
Magento doesn’t use NOW() from MySQL, but do use
CURRENT_TIMESTAMP in schema.xml’s
Keep in sync app time with db time
In CronJob, within module Sales, Magento uses
CURRENT_TIMESTAMP to clean up overdue orders
Magento (5)
MagentoFrameworkStdlib
namespace MagentoEavModelEntityAttributeBackendTime;
class Created
public function beforeSave($object)
{...
$object->setData(
$attributeCode,
gmdate(MagentoFrameworkStdlibDateTime::DATETIME_PHP_FORM
AT)
...}
PHP (1)
In directory ext/date
● php_date.c -> gmdate definition uses mostly timelib_time struct
● timelib.c
typedef struct _timelib_time {
timelib_sll y, m, d; /* Year, Month, Day */
timelib_sll h, i, s; /* Hour, mInute, Second */
timelib_sll us; /* Microseconds */
int z; /* UTC offset in seconds*/
timelib_sll sse; /* Seconds since epoch*/
...
PHP (2)
...
unsigned int have_time, have_date, have_zone,
have_relative, have_weeknr_day;
unsigned int sse_uptodate; /* !0 if the sse member
is up to date with the date/time members */
unsigned int tim_uptodate; /* !0 if the date/time
members are up to date with the sse member */
unsigned int is_localtime; /* 1 if the current
struct represents localtime, 0 if it is in GMT */
...
PHP (3)
...
unsigned int zone_type;
/* 1 time offset,
* 3 TimeZone identifier,
* 2 TimeZone abbreviation */
} timelib_time;
PHP (4)
/* {{{ proto int time(void)
Return current UNIX timestamp */
PHP_FUNCTION(time)
{
RETURN_LONG((zend_long)time(NULL));
}
/* }}} */
Update for PHP
...
Release 2018g - 2018-10-26 22:22:45 -0700
Briefly:
Morocco switches to permanent +01 on 2018-10-27.
Changes to future timestamps
Morocco switches from +00/+01 to permanent +01 effective
2018-10-27,
so its clocks will not fall back on 2018-10-28 as
previously scheduled.
(Thanks to Mohamed Essedik Najd and Brian Inglis.)
...
C (1)
time()
seconds from 00:00:00 on January 1, 1970
03:14:07 UTC on January 19, 2038
CLOCKS_PER_SEC
Ubuntu (1)
● date
● timedatectl
Local time: Mon 2018-12-03 20:06:58 CET
Universal time: Mon 2018-12-03 19:06:58 UTC
RTC time: Mon 2018-12-03 19:06:58
Time zone: Europe/Berlin (CET, +0100)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
...
Ubuntu (2)
...
DST active: no
Last DST change: DST ended at
Sun 2018-10-28 02:59:59 CEST
Sun 2018-10-28 02:00:00 CET
Next DST change: DST begins (the clock jumps one hour
forward) at
Sun 2019-03-31 01:59:59 CET
Sun 2019-03-31 03:00:00 CEST
Ubuntu (3)
Network Time Protocol
STRATUM 0-15
4 s - 17 min (avg: 64 s)
Discussion
● https://www.iana.org/time-zones
● https://www.youtube.com/watch?v=-5wpm-gesOY - MUST SEE
● https://www.youtube.com/watch?v=Wd2EEResjQU
● https://www.youtube.com/watch?v=0j74jcxSunY
● https://docs.magento.com
● http://www.open-std.org/JTC1/sc22/wg14/www/docs/n1256.pdf
Bibliography

More Related Content

What's hot

CRONtab Tutorial
CRONtab TutorialCRONtab Tutorial
CRONtab Tutorial
Joseph ...
 
Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...
Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...
Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...
Artjom Simon
 
Concurrency in Go by Denys Goldiner.pdf
Concurrency in Go by Denys Goldiner.pdfConcurrency in Go by Denys Goldiner.pdf
Concurrency in Go by Denys Goldiner.pdf
Denys Goldiner
 
Proove Mark&Sweep GC with Coq
Proove Mark&Sweep GC with CoqProove Mark&Sweep GC with Coq
Proove Mark&Sweep GC with CoqHiroki Mizuno
 
Resource element lte explanations!
Resource element lte explanations!Resource element lte explanations!
Resource element lte explanations!
Bobir Shomaksudov
 
Markov Model for TMR System with Repair
Markov Model for TMR System with RepairMarkov Model for TMR System with Repair
Markov Model for TMR System with Repair
Sujith Jay Nair
 
Payment Channel Introduction
Payment Channel IntroductionPayment Channel Introduction
Payment Channel Introduction
mosa siru
 
Some Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDTSome Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDT
Framgia Vietnam
 
unix crontab basics
unix crontab basicsunix crontab basics
unix crontab basics
saratsandhya
 
[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe
SAP HANA Cloud Platform
 
Epoch Time
Epoch TimeEpoch Time
Epoch Time
Gurudutt07
 
Even up and down counter
Even up and down counterEven up and down counter
Even up and down counterPrasad Rockzz
 
Chapter 3 Commands at MATLAB Command Window
Chapter 3 Commands at MATLAB Command WindowChapter 3 Commands at MATLAB Command Window
Chapter 3 Commands at MATLAB Command Window
Pranoti Doke
 
20161206 うるう秒社内勉強会 社外向け資料
20161206 うるう秒社内勉強会 社外向け資料20161206 うるう秒社内勉強会 社外向け資料
20161206 うるう秒社内勉強会 社外向け資料
Tsuyoshi Hisamatsu
 
maXbox Blix the Programmer
maXbox Blix the ProgrammermaXbox Blix the Programmer
maXbox Blix the Programmer
Max Kleiner
 
Tower of hanoi
Tower of hanoiTower of hanoi
Tower of hanoi
murdhani heena
 
Auntonomous second no4
Auntonomous second no4Auntonomous second no4
Auntonomous second no4
Jun Terauchi
 
Knit One, Compute One - Software Art Thou?
Knit One, Compute One - Software Art Thou?Knit One, Compute One - Software Art Thou?
Knit One, Compute One - Software Art Thou?
Kristine Howard
 

What's hot (20)

CRONtab Tutorial
CRONtab TutorialCRONtab Tutorial
CRONtab Tutorial
 
Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...
Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...
Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...
 
Storm
StormStorm
Storm
 
Concurrency in Go by Denys Goldiner.pdf
Concurrency in Go by Denys Goldiner.pdfConcurrency in Go by Denys Goldiner.pdf
Concurrency in Go by Denys Goldiner.pdf
 
Proove Mark&Sweep GC with Coq
Proove Mark&Sweep GC with CoqProove Mark&Sweep GC with Coq
Proove Mark&Sweep GC with Coq
 
Resource element lte explanations!
Resource element lte explanations!Resource element lte explanations!
Resource element lte explanations!
 
Markov Model for TMR System with Repair
Markov Model for TMR System with RepairMarkov Model for TMR System with Repair
Markov Model for TMR System with Repair
 
TypeScript
TypeScriptTypeScript
TypeScript
 
Payment Channel Introduction
Payment Channel IntroductionPayment Channel Introduction
Payment Channel Introduction
 
Some Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDTSome Tricks in Using Terminal - KienDT
Some Tricks in Using Terminal - KienDT
 
unix crontab basics
unix crontab basicsunix crontab basics
unix crontab basics
 
[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe
 
Epoch Time
Epoch TimeEpoch Time
Epoch Time
 
Even up and down counter
Even up and down counterEven up and down counter
Even up and down counter
 
Chapter 3 Commands at MATLAB Command Window
Chapter 3 Commands at MATLAB Command WindowChapter 3 Commands at MATLAB Command Window
Chapter 3 Commands at MATLAB Command Window
 
20161206 うるう秒社内勉強会 社外向け資料
20161206 うるう秒社内勉強会 社外向け資料20161206 うるう秒社内勉強会 社外向け資料
20161206 うるう秒社内勉強会 社外向け資料
 
maXbox Blix the Programmer
maXbox Blix the ProgrammermaXbox Blix the Programmer
maXbox Blix the Programmer
 
Tower of hanoi
Tower of hanoiTower of hanoi
Tower of hanoi
 
Auntonomous second no4
Auntonomous second no4Auntonomous second no4
Auntonomous second no4
 
Knit One, Compute One - Software Art Thou?
Knit One, Compute One - Software Art Thou?Knit One, Compute One - Software Art Thou?
Knit One, Compute One - Software Art Thou?
 

Similar to Magento Meetup Wroclaw Date And Time In Magento With Multistore (Maciej Harbuz, X-Coding IT Studio

jkfdlsajfklafj
jkfdlsajfklafjjkfdlsajfklafj
jkfdlsajfklafj
PlanetExpressATX
 
JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8
Serhii Kartashov
 
Why a whole country skipped a day - Fun with Timezones
Why a whole country skipped a day - Fun with Timezones Why a whole country skipped a day - Fun with Timezones
Why a whole country skipped a day - Fun with Timezones
Kai Koenig
 
Java 8 Date and Time API
Java 8 Date and Time APIJava 8 Date and Time API
Java 8 Date and Time API
Ganesh Samarthyam
 
Lesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptx
LagamaPasala
 
Getting date and time from ntp server with esp8266 node mcu
Getting date and time from ntp server with esp8266 node mcuGetting date and time from ntp server with esp8266 node mcu
Getting date and time from ntp server with esp8266 node mcu
Elaf A.Saeed
 
Unit iii-Synchronization
Unit iii-SynchronizationUnit iii-Synchronization
Unit iii-Synchronization
Dhivyaa C.R
 
Php date & time functions
Php date & time functionsPhp date & time functions
Php date & time functions
Programmer Blog
 
Timers
TimersTimers
Timer
TimerTimer
Introduction to Date and Time API 3
Introduction to Date and Time API 3Introduction to Date and Time API 3
Introduction to Date and Time API 3
Kenji HASUNUMA
 
Introduction to Date and Time API 4
Introduction to Date and Time API 4Introduction to Date and Time API 4
Introduction to Date and Time API 4
Kenji HASUNUMA
 
Introduction to Date and Time API 3
Introduction to Date and Time API 3Introduction to Date and Time API 3
Introduction to Date and Time API 3
Kenji HASUNUMA
 
L12.FA20.ppt
L12.FA20.pptL12.FA20.ppt
L12.FA20.ppt
MAliHaider4
 
Introduction to Date and Time API 4
Introduction to Date and Time API 4Introduction to Date and Time API 4
Introduction to Date and Time API 4
Kenji HASUNUMA
 
Distributed system TimeNState-Tanenbaum.ppt
Distributed system TimeNState-Tanenbaum.pptDistributed system TimeNState-Tanenbaum.ppt
Distributed system TimeNState-Tanenbaum.ppt
TantraNathjha1
 
Clock.pdf
Clock.pdfClock.pdf
Clock.pdf
MohdAbdulHaque
 
4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)
PROIDEA
 

Similar to Magento Meetup Wroclaw Date And Time In Magento With Multistore (Maciej Harbuz, X-Coding IT Studio (20)

doc
docdoc
doc
 
jkfdlsajfklafj
jkfdlsajfklafjjkfdlsajfklafj
jkfdlsajfklafj
 
JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8
 
Why a whole country skipped a day - Fun with Timezones
Why a whole country skipped a day - Fun with Timezones Why a whole country skipped a day - Fun with Timezones
Why a whole country skipped a day - Fun with Timezones
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Java 8 Date and Time API
Java 8 Date and Time APIJava 8 Date and Time API
Java 8 Date and Time API
 
Lesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptx
 
Getting date and time from ntp server with esp8266 node mcu
Getting date and time from ntp server with esp8266 node mcuGetting date and time from ntp server with esp8266 node mcu
Getting date and time from ntp server with esp8266 node mcu
 
Unit iii-Synchronization
Unit iii-SynchronizationUnit iii-Synchronization
Unit iii-Synchronization
 
Php date & time functions
Php date & time functionsPhp date & time functions
Php date & time functions
 
Timers
TimersTimers
Timers
 
Timer
TimerTimer
Timer
 
Introduction to Date and Time API 3
Introduction to Date and Time API 3Introduction to Date and Time API 3
Introduction to Date and Time API 3
 
Introduction to Date and Time API 4
Introduction to Date and Time API 4Introduction to Date and Time API 4
Introduction to Date and Time API 4
 
Introduction to Date and Time API 3
Introduction to Date and Time API 3Introduction to Date and Time API 3
Introduction to Date and Time API 3
 
L12.FA20.ppt
L12.FA20.pptL12.FA20.ppt
L12.FA20.ppt
 
Introduction to Date and Time API 4
Introduction to Date and Time API 4Introduction to Date and Time API 4
Introduction to Date and Time API 4
 
Distributed system TimeNState-Tanenbaum.ppt
Distributed system TimeNState-Tanenbaum.pptDistributed system TimeNState-Tanenbaum.ppt
Distributed system TimeNState-Tanenbaum.ppt
 
Clock.pdf
Clock.pdfClock.pdf
Clock.pdf
 
4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 

Magento Meetup Wroclaw Date And Time In Magento With Multistore (Maciej Harbuz, X-Coding IT Studio

  • 1. What will happen when we stop adjusting clocks? Maciej Harbuz X-Coding IT Studio Date and time in Magento with multistore
  • 2. Today, we’re going to present how Magento handle different timezones in different stores.
  • 3. How long takes a day ● daylight ● star day ● moon day General
  • 5. 1967r. czas trwania 9 192 631 770 okresów fali świetlnej promieniowania odpowiadającego przejściu między dwoma poziomami struktury nadsubtelnej stanu podstawowego atomu cezu 133 Cs Leap second 23:59:59 23:59:60 00:00:00 General
  • 6. 360° / 24h = 15 °/h There are 38 different time zones UTC-09:30 UTC+05:45 UTC+14:00 General
  • 7.
  • 10. Magento (2) Timezone change per website/store affects datetime in admin panel because that isn’t saved persistent within order
  • 11. Magento (3) //convert time from UTC to admin store timezone //we assume that all schedules in configuration (crontab.xml and DB tables) are in admin store timezone $time = $this->timezoneConverter->date($time) ->format('Y-m-d H:i');
  • 12. Magento (4) Magento doesn’t use NOW() from MySQL, but do use CURRENT_TIMESTAMP in schema.xml’s Keep in sync app time with db time In CronJob, within module Sales, Magento uses CURRENT_TIMESTAMP to clean up overdue orders
  • 13. Magento (5) MagentoFrameworkStdlib namespace MagentoEavModelEntityAttributeBackendTime; class Created public function beforeSave($object) {... $object->setData( $attributeCode, gmdate(MagentoFrameworkStdlibDateTime::DATETIME_PHP_FORM AT) ...}
  • 14. PHP (1) In directory ext/date ● php_date.c -> gmdate definition uses mostly timelib_time struct ● timelib.c typedef struct _timelib_time { timelib_sll y, m, d; /* Year, Month, Day */ timelib_sll h, i, s; /* Hour, mInute, Second */ timelib_sll us; /* Microseconds */ int z; /* UTC offset in seconds*/ timelib_sll sse; /* Seconds since epoch*/ ...
  • 15. PHP (2) ... unsigned int have_time, have_date, have_zone, have_relative, have_weeknr_day; unsigned int sse_uptodate; /* !0 if the sse member is up to date with the date/time members */ unsigned int tim_uptodate; /* !0 if the date/time members are up to date with the sse member */ unsigned int is_localtime; /* 1 if the current struct represents localtime, 0 if it is in GMT */ ...
  • 16. PHP (3) ... unsigned int zone_type; /* 1 time offset, * 3 TimeZone identifier, * 2 TimeZone abbreviation */ } timelib_time;
  • 17. PHP (4) /* {{{ proto int time(void) Return current UNIX timestamp */ PHP_FUNCTION(time) { RETURN_LONG((zend_long)time(NULL)); } /* }}} */
  • 18. Update for PHP ... Release 2018g - 2018-10-26 22:22:45 -0700 Briefly: Morocco switches to permanent +01 on 2018-10-27. Changes to future timestamps Morocco switches from +00/+01 to permanent +01 effective 2018-10-27, so its clocks will not fall back on 2018-10-28 as previously scheduled. (Thanks to Mohamed Essedik Najd and Brian Inglis.) ...
  • 19. C (1) time() seconds from 00:00:00 on January 1, 1970 03:14:07 UTC on January 19, 2038 CLOCKS_PER_SEC
  • 20. Ubuntu (1) ● date ● timedatectl Local time: Mon 2018-12-03 20:06:58 CET Universal time: Mon 2018-12-03 19:06:58 UTC RTC time: Mon 2018-12-03 19:06:58 Time zone: Europe/Berlin (CET, +0100) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no ...
  • 21. Ubuntu (2) ... DST active: no Last DST change: DST ended at Sun 2018-10-28 02:59:59 CEST Sun 2018-10-28 02:00:00 CET Next DST change: DST begins (the clock jumps one hour forward) at Sun 2019-03-31 01:59:59 CET Sun 2019-03-31 03:00:00 CEST
  • 22. Ubuntu (3) Network Time Protocol STRATUM 0-15 4 s - 17 min (avg: 64 s)
  • 24. ● https://www.iana.org/time-zones ● https://www.youtube.com/watch?v=-5wpm-gesOY - MUST SEE ● https://www.youtube.com/watch?v=Wd2EEResjQU ● https://www.youtube.com/watch?v=0j74jcxSunY ● https://docs.magento.com ● http://www.open-std.org/JTC1/sc22/wg14/www/docs/n1256.pdf Bibliography