Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
日付と闘う-和暦は難しい / vs Dates - Japanese Chronology i...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
wkwkhautbois
June 16, 2024
Programming
2.7k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
日付と闘う-和暦は難しい / vs Dates - Japanese Chronology is Difficult
JJUG CCC 2024 Spring 懇親会LT スライド
Javaで和暦を扱うときの どうして(´・ω・`)ショボーン について
wkwkhautbois
June 16, 2024
More Decks by wkwkhautbois
See All by wkwkhautbois
JavaとKotlinで例外処理の相性が悪いなと思った瞬間(2023/09/29 Server-Side Kotlin Meetup vol.10 )
wkwkhautbois
0
920
Other Decks in Programming
See All in Programming
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
220
Performance Optimization With LLMs
xleitix
0
250
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
160
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
150
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
190
AmebaブログはKMPから卒業します
kmars0605
0
340
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
120
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
310
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
220
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
240
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
800
はじめてのPLATEAU
nokonoko1203
1
620
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
The browser strikes back
jonoalderson
0
1.9k
The untapped power of vector embeddings
frankvandijk
2
2k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
550
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
570
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Color Theory Basics | Prateek | Gurzu
gurzu
1
510
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
910
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.2k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
390
How to Ace a Technical Interview
jacobian
280
24k
Transcript
⽇付と闘う - 和暦は難しい - わくわく JJUG CCC 2024 Spring 懇親会LT
1
⾃⼰紹介 • 名前 • わくわく • 仕事 • シェルフィー株式会社 •
建設業界向けのSaaS事業 X(Twitter) ブログ https://wkwkhautbois.hatenablog.jp/ @wkwk_hautbois https://zenn.dev/wkwkhautbois Zenn 2
建設業界は 法律・必要な資格がたくさん 3
そんなとき登場するのが…? 4
令和6年6⽉16⽇ 和暦 5
JapaneseDate (以降これ使う前提で進めます) 6
平成はいつまで? ところで 7
平成はいつまで? 2019-04-30 平成31年4⽉30⽇ ところで 8
平成33年7⽉8⽇まで有効 改元の話題が出る前 いい感じに扱えないか 9
parse してから format してみる 10
平成31年5⽉1⽇ JapaneseDate.from(fmt.parse("平成31年5⽉1⽇")).format(fmt)) 11
平成31年5⽉1⽇ ↓ 令和1年5⽉1⽇ JapaneseDate.from(fmt.parse("平成31年5⽉1⽇")).format(fmt)) 👏 12
平成33年7⽉8⽇ JapaneseDate.from(fmt.parse("平成33年7⽉8⽇")).format(fmt)) 13
平成33年7⽉8⽇ ↓ 令和3年7⽉8⽇ JapaneseDate.from(fmt.parse("平成33年7⽉8⽇")).format(fmt)) DateTimeParseException 14 最後に 追記あり
どうして(´・ω・`) 15 最後に 追記あり
次は ⼯事現場にて 16
建設業の許可票 商号⼜は名称 代表者の⽒名 ... ... 許可番号 許可年⽉⽇ 東京都知事 許可(1)第99999号 R1.05.27
⼯事現場にあるやつ 17
建設業の許可票 商号⼜は名称 代表者の⽒名 ... ... 許可番号 許可年⽉⽇ 東京都知事 許可(1)第99999号 R1.05.27
⼯事現場にあるやつ 許可年度 18
年⽉⽇から 年度を求めるには? 19
わりと強引に... if(許可⽉ < 4) { // 許可年 ‒ 1 //
etc. } else { // 許可年 } 20
⾃治体によって 表記に揺れがあったりする 平成31年度 or 令和1年度 21
どうして(´・ω・`) 22
ふたたび資格 23
ふたたび資格 有効期限が年末まで 24
TemporalAdjusters.lastDayOfYear() 25
今⽇ 26
今⽇ ↓ 令和6年12⽉31⽇ 27
平成31年1⽉1⽇ 28
平成31年1⽉1⽇ ↓ 平成31年4⽉30⽇❗ 29 最後に 追記あり
令和1年5⽉1⽇ 30
令和1年5⽉1⽇ ↓ 令和1年9⽉2⽇ ⁉ 5/1〜12/31までの⽇数を 1/1に⾜している 31 最後に 追記あり
どうして(´・ω・`) 32 最後に 追記あり
和暦は難しい 33
⽇付と闘う おわり 和暦 追記へ
X(Twitter)で 挙動の説明をいただきました 35 追記
36 追記
37 追記
⽇付と闘う おわり 和暦 闘う仲間 募集中! https://hello.shelfy.co.jp/ 38 追記