日本時間の取得と表示

year
PHP
<?php
date_default_timezone_set('Asia/Tokyo');
$year = date('Y');
?>
PHP
<?php echo date_i18n('Y'); ?>
JavaScript
const year = new Intl.DateTimeFormat("en-US", {
  timeZone: "Asia/Tokyo",
  year: "numeric"
}).format(new Date());

Loading...