Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Time
Search
Dirkjan Bussink
February 10, 2015
Programming
120
0
Share
Time
A talk about how to handle time and timezones. Given at Twente.rb
Dirkjan Bussink
February 10, 2015
More Decks by Dirkjan Bussink
See All by Dirkjan Bussink
Managing a widely distributed team
dbussink
1
200
The tricky truth about parallel execution and modern hardware
dbussink
0
370
The future of Ruby is faster
dbussink
3
550
Security for dummies
dbussink
1
180
The myth of dynamic language performance
dbussink
3
490
Rubinius - Tales from the trenches @ Railsclub.ru 2012
dbussink
2
230
Rubinius - Tales from the trenches @ Baruco 2012
dbussink
1
280
Rubinius Eurucamp 2012 Workshop
dbussink
2
140
Rubinius Euruko 2012 Lightning talk
dbussink
2
250
Other Decks in Programming
See All in Programming
へんな働き方
yusukebe
6
2.9k
KagglerがMixSeekを触ってみた
morim
0
370
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
220
Rethinking API Platform Filters
vinceamstoutz
0
9.9k
Spec Driven Development: The End Of Vibe Coding | DevLand 2026
danielsogl
PRO
0
110
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
320
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
5
2.5k
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
160
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
710
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
970
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
150
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
100
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
22k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
470
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
360
Marketing to machines
jonoalderson
1
5.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1k
It's Worth the Effort
3n
188
29k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
390
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
110
How to build a perfect <img>
jonoalderson
1
5.3k
Transcript
Time Dirkjan Bussink! @dbussink
Time is hard
None
None
None
None
None
Basics
None
Timezones
http://momentjs.com/
http://momentjs.com/
Storing
UTC
Why?
2014-10-26 02:34
A bit more! complicated
Group! by date
None
Who’s date?
http://pellepim.bitbucket.org/jstz/
None
None
Calculations
None
Perspective
None
UTC loses data
UTC + offset
2014-08-19 16:12:50 +0200
Time as a feature
Calendars
None
None
DST
amsterdam = ActiveSupport::TimeZone["Europe/Amsterdam"] time = amsterdam.parse("2014-08-19 17:15") => Tue, 19
Aug 2014 17:15:00 CEST +02:00
sydney = ActiveSupport::TimeZone[“Australia/Sydney"] ! time => Tue, 19 Aug 2014
17:15:00 CEST +02:00 time.in_time_zone(sydney) => Wed, 20 Aug 2014 01:15:00 EST +10:00
later = time + 6.months => Thu, 19 Feb 2015
17:15:00 CET +01:00 ! later.in_time_zone(sydney) => Fri, 20 Feb 2015 03:15:00 EST +11:00
Our recurring meeting! just moved 2 hours!
UTC + offset! isn’t good enough
Time & time zone Europe/Amsterdam Tue, 19 Aug 2014 17:15:00
CEST +02:00
Time tracking
Check in & check out
125% 22:00 00:00 150% Break 150% 01:00 01:30 06:00
DST
125% 150% Break 150% 01:30 02:00 02:59 02:00 03:00
9 hours from 22:00 until 06:00
Very specific! storage format
Day!! ! ! ! ! ! ! 2014-10-26! Start!! !
! ! ! ! 79200!! ! ! End!! ! ! ! ! ! ! 108000! Duration!! ! 32400
Take away
Start with UTC
Be careful! with timezones
Make conscious! decisions