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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Dirkjan Bussink
February 10, 2015
Programming
130
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
560
Security for dummies
dbussink
1
190
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
290
Rubinius Eurucamp 2012 Workshop
dbussink
2
140
Rubinius Euruko 2012 Lightning talk
dbussink
2
250
Other Decks in Programming
See All in Programming
From Formal Specification to Property Based Test
ohbarye
0
340
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
230
GoogleCloudとterraform完全に理解した
terisuke
1
160
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
800
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
110
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
490
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
830
Agentic Elixir
whatyouhide
0
410
GitHubCopilotCLIをはじめよう.pdf
htkym
0
270
Swift Concurrency Type System
inamiy
1
550
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
290
ハーネスエンジニアリングとは?
kinopeee
13
6.1k
Featured
See All Featured
Fireside Chat
paigeccino
42
3.9k
Writing Fast Ruby
sferik
630
63k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
64
54k
Documentation Writing (for coders)
carmenintech
77
5.3k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
260
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
53k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
140
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
280
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