The WordPress time zone is set to UTC . If this is used, the time will be off.
current_time ($ type, $ gmt = 0)
The argument $ type is timestamp or mysql ".
Or you can include 日付書式文字列 .
In the case mysql , the result is returned in date-time string format .
In the case timestamp , it can be used instead of time .
If you want to get the WordPress blog local time, it will be
When returning UTC time using the second argument, it will be
current_time ('timestamp', true) In other words, to keep the time on WordPress
Use current_time ('timestamp') .
Example: To get the current date and time
Example: Get yesterday's date using date, strototime