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
0
110
Time
A talk about how to handle time and timezones. Given at Twente.rb
Dirkjan Bussink
February 10, 2015
Tweet
Share
More Decks by Dirkjan Bussink
See All by Dirkjan Bussink
Managing a widely distributed team
dbussink
1
190
The tricky truth about parallel execution and modern hardware
dbussink
0
340
The future of Ruby is faster
dbussink
3
540
Security for dummies
dbussink
1
160
The myth of dynamic language performance
dbussink
3
450
Rubinius - Tales from the trenches @ Railsclub.ru 2012
dbussink
2
210
Rubinius - Tales from the trenches @ Baruco 2012
dbussink
1
260
Rubinius Eurucamp 2012 Workshop
dbussink
2
120
Rubinius Euruko 2012 Lightning talk
dbussink
2
240
Other Decks in Programming
See All in Programming
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
790
Six and a half ridiculous things to do with Quarkus
hollycummins
0
200
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
310
CSC305 Lecture 06
javiergs
PRO
0
260
Writing Better Go: Lessons from 10 Code Reviews
konradreiche
2
4.9k
なぜGoのジェネリクスはこの形なのか? - Featherweight Goが明かす設計の核心
qualiarts
0
210
コードとあなたと私の距離 / The Distance Between Code, You, and I
hiro_y
0
190
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
350
Go言語はstack overflowの夢を見るか?
logica0419
0
500
いま中途半端なSwift 6対応をするより、Default ActorやApproachable Concurrencyを有効にしてからでいいんじゃない?
yimajo
2
450
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
340
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
2
640
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
Speed Design
sergeychernyshev
32
1.2k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
190
55k
Designing Experiences People Love
moore
142
24k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
For a Future-Friendly Web
brad_frost
180
10k
Mobile First: as difficult as doing things right
swwweet
225
10k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Into the Great Unknown - MozCon
thekraken
40
2.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
115
20k
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