반응형
datetime
-
php 시간 표현 예시 - dateTime 사용 예시프로그래밍/PHP 2020. 12. 31. 23:31
- 현재 시간 구하기 (YYYY-mm-dd) format $current_date = new DateTime(); $current_date->format('Y-m-d'); - 현재 요일 구하기 function get_day_of_week($sql_date){ $updated_date = new DateTime($sql_dat); $day_of_week = $updated_date->format('D'); return $day_of_week;} - 두 시간 표현 간 시간 차이 구하기 참고: http://haruair.com/blog/1871, http://php.net/manual/kr/datetime.diff.php public DateInterval DateTime::diff ( DateTimeInte..