LoginSignup
10
10

More than 5 years have passed since last update.

各種言語・ライブラリの日付フォーマット

Last updated at Posted at 2014-05-16

年月日時分秒をゼロパディング (例:2014-05-16 11:48:12)

ruby Time#strftime()

Time.now.strftime("%Y-%m-%d %H:%M:%S")

moment.js format()

moment().format('YYYY-MM-DD HH:mm:ss')

php date()

date("Y-m-d H:i:s")

angular.js filter:date

{{new Date() | date:'yyyy-MM-dd HH:mm:ss'}}

perl POSIX::strftime

POSIX::strftime "%Y-%m-%d %H:%M:%S", localtime(time);

python datetime#strftime

datetime.now().strftime("%Y-%m-%d %H:%M:%S")

ruby, python, perlは同じC標準。

10
10
0

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
10
10