"First day of this month"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
 
(다른 사용자 한 명의 중간 판 4개는 보이지 않습니다)
3번째 줄: 3번째 줄:
;first day of this month
;first day of this month
;first_of_this_month
;first_of_this_month
*Returns the last day of the month
*Returns the first day of this month
*void → YYYY-MM-01
*void → YYYY-MM-01
*=first_day(today())
*=first_day(today())
10번째 줄: 10번째 줄:
==Bash==
==Bash==
[[category: Bash]]
[[category: Bash]]
<source lang='bash'>
<syntaxhighlight lang='bash'>
FIRST_OF_MONTH=`date +%Y-%m-01`
FIRST_OF_MONTH=`date +%Y-%m-01`
echo $FIRST_OF_MONTH
echo $FIRST_OF_MONTH
</source>
</syntaxhighlight>


==PHP==
==PHP==
[[category: PHP]]
[[category: PHP]]
<source lang='php'>
<syntaxhighlight lang='php'>
$first_day = date("Y-m-d", strtotime(date('Y-m').'-01'));
$first_day = date("Y-m-d", strtotime(date('Y-m').'-01'));
</source>
</syntaxhighlight>


==SQL==
==SQL==
25번째 줄: 25번째 줄:
===MySQL===
===MySQL===
[[category: MySQL]]
[[category: MySQL]]
<source lang='sql'>
<syntaxhighlight lang='sql'>
SELECT CONCAT(SUBSTR(CURDATE(),1,8),"01");
SELECT CONCAT(SUBSTR(CURDATE(),1,8),"01");
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
*[[first_of_month]]
* [[this month]]
*[[last_of_this_month]]
* [[first_of_month]]
* [[last_of_this_month]]

2020년 11월 2일 (월) 02:34 기준 최신판

1 개요[ | ]

first day of this month
first_of_this_month
  • Returns the first day of this month
  • void → YYYY-MM-01
  • =first_day(today())
  • =first_day(this_month())

2 Bash[ | ]

FIRST_OF_MONTH=`date +%Y-%m-01`
echo $FIRST_OF_MONTH

3 PHP[ | ]

$first_day = date("Y-m-d", strtotime(date('Y-m').'-01'));

4 SQL[ | ]

4.1 MySQL[ | ]

SELECT CONCAT(SUBSTR(CURDATE(),1,8),"01");

5 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}