6
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Java/Scala/PHPの日付フォーマット対応表

Last updated at Posted at 2015-03-09

PHPのdate関数に使える日付フォーマットと、Java/ScalaのSimpleDateFormatjoda-timeで使える日付フォーマットの対応表です。

日付フォーマット対応表

|	PHP	|	Java/Scala	|	例

---|---|---|---
年(2桁) | y | yy | 99や06
年(4桁) | Y | yyyy | 1999や2006
月 | n | M | 1 から 12
月(ゼロ埋め) | m | MM | 01 から 12
月(テキスト) | M | MMM | Jan から Dec
日 | j | d | 1 から 31
日(ゼロ埋め) | d | dd | 01 から 31
時(12時間) | g | h | 1 から 12
時(24時間) | G | H | 0 から 23
時(12時間、ゼロ埋め) | h | hh | 01 から 12
時(24時間、ゼロ埋め) | H | HH | 00 から 23
分 | なし | m | 0 から 59
分(ゼロ埋め) | i | mm | 00 から 59
秒 | なし | s | 0 から 59
秒(ゼロ埋め) | s | ss | 00 から 59

よく使うフォーマットの対応表

PHP Java/Scala
Y-m-d H:i:s yyyy-MM-dd HH:flag_mm:ss 2006-01-02 15:04:05
Y/m/d H:i:s yyyy/MM/dd HH:flag_mm:ss 2006/01/02 15:04:05

関連

6
9
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?