Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

PHPで日本語の曜日出す

More than 3 years have passed since last update.

なんやかんやで毎回使う

class Common {
    static $WEEKS = ['(日)', '(月)', '(火)', '(水)', '(木)', '(金)', '(土)'];

    function date($format, $timestamp=null) {
        if ( preg_match('/x/', $format) ) {
            $w = date('w', $timestamp);
            $format = preg_replace('/x/', self::$WEEKS[$w], $format);
        }
        return date($format, $timestamp);
    }
}

$Common = new Common();
$Common->date('Y年m月d日x H:i', strtotime('2017-03-17 12:00:00'));
// 2017年03月17日(金) 12:00

PHPで和暦・日本語曜日を使う

ki6ool
絶対ワードプレス使うマン
https://6oolab.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away