愚者樹屋

|
Home About Contact
|

series

3d軟體 (1) apache (1) css (4) eagle (1) godot (9) google-api (1) google翻譯 (1) html (6) hugo安裝 (7) javasciprt (1) javascript (14) jquery (3) mysql (9) notepad++ (1) php (33) python (1) unity (1) yt-dlp (1) 像素畫 (1) 免費軟體 (8) 壓力測試 (2) 弱點掃描修補 (1) 無障礙網站 (1) 社群網站 (1) 遊戲推薦 (5) 雜記 (1)

Tags

2d軟體 3d軟體 ai ai代理 apache css eagle godot google-api google翻譯 html hugo javasciprt javascript jquery mysql notepad++ php python tcpdf

php取得星期幾

post date - 2023/11/11
last update - 2023/11/11

第一次碰到了需要在固定星期幾執行的功能,順便做個紀錄。

方法

date中就有參數可以取得

date("N");//1(星期一)到 7(星期天)
date("w");//0(星期天)到 6(星期六)

字串的判斷先產生日期格式然後再取出

    $dtime = DateTime::createFromFormat("2000-01-01", date("Y-m-d"));
    echo $dtime->format('N');

參考資料

https://www.php.net/manual/en/datetime.format.php

Tags : php

series

3d軟體 (1) apache (1) css (4) eagle (1) godot (9) google-api (1) google翻譯 (1) html (6) hugo安裝 (7) javasciprt (1) javascript (14) jquery (3) mysql (9) notepad++ (1) php (33) python (1) unity (1) yt-dlp (1) 像素畫 (1) 免費軟體 (8) 壓力測試 (2) 弱點掃描修補 (1) 無障礙網站 (1) 社群網站 (1) 遊戲推薦 (5) 雜記 (1)

Tags

2d軟體 3d軟體 ai ai代理 apache css eagle godot google-api google翻譯 html hugo javasciprt javascript jquery mysql notepad++ php python tcpdf

Recent Posts

孔明舞(チキチキバンバン)跳舞用法

2022/12/18

jquery阻止冒泡bubbling

2023/02/12

php字串搜尋

2022/10/15

aseprite 筆記

2024/03/16

godot攜帶版設定

2024/08/11

mastodon misskey pixiv plurk twitter 巴哈姆特

© 2022-2026 愚者樹屋