LoginSignup
3
1

More than 5 years have passed since last update.

[ メモ ] php date関数 現在の日付・時間を取得

Last updated at Posted at 2018-05-20

phpで現在の日付・時間を取得する関数 「 date( ) 」

フォームの生年月日を入力する部分で、使用したので書いておきます。

index.php
$now = date("Y");

echo $now;

2018

オプション

パラメータ    説明        表示例
d 日 (二桁の数字)  01 , 20
D        曜日           Sun , Fri
m      月(二桁の数字) 04 , 11
Y 年(四桁の数字) 2018 , 1990
H 時(24時間単位) 07 , 23
i        分(二桁の数字) 01 , 55
s        秒(二桁の数字) 03 , 40
3
1
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
3
1