JavaScript での時刻操作に Moment.js ではなく Day.js を利用し続けている理由2020/09/21 昨日、拙作の Nuxt.js プラグインである @nuxtjs/dayjs の v1.2.0 をリリースしました。 このプラグイン自体は2019年3月に開発をはじめて、おおよそ一年半ほど管理してるのですが、それ以前から JavaScript での時刻操作では Day.js を使ってきました。 Moment.js のプロジェクト終了が告知され、時刻操作ライブラリに注目が集まっていることなので、今一度 Day.js の採用理由についてまとめてみます。 Day.js について iamkun によって開発されている時刻操作のライブラリです。Moment や date-fns などは Organization によって管理されていますが、時刻操作ライブラリとしては珍しく個人に
最近は C# や SQL Server を使っているので、Java や MySQL で遊ぶ時間がなくなってしまいました。ちょっと眠っていたネタがあったので忘れる前に書き残しておきます。 日時の国際化 日時の国際化というと、時差の変換が一番イメージしやすいかと思います。例えば twitter の場合、海外のツイートでも、タイムラインでは日本時間で表示されますよね?これを実装する場合、内部的には UTC 時間で保存しておいて、表示する人のタイムゾーンに合わせて時差を変換してやるのが一般的かと思います。 保存先に RDB を使う場合、WHERE で絞り込んだり、ORDER BY でソートする分には、タイムゾーン変換は不要なので、レコードを取得した後にアプリケーション側でタイムゾーン変換をすれば問題ありません。 だけど、GROUP BY を使って日ごとに集計をする場合、UTC をその人のタイムゾー
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く