일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- composer-php
- 무료다운로드쿠폰
- Laravel
- php
- 웹하드추천
- JSON
- variables
- Forms
- function
- post
- 전략
- Session
- jquery
- Ajax
- 웹하드순위
- 경영
- Apache
- OOP
- JavaScript
- curl
- date
- string
- file-upload
- MySQL
- Regex
- UTF-8
- HTML
- Linux
- Arrays
- Today
- Total
목록date (8)
개발! 딱 깔끔하고 센스있게!
PHP 프로그램을 개발하고 있습니다. 나는 날짜 변수와 문자열 변수를 비교해야 합니다.나는 strcmp 해봤는데 소용이 없다...건의감사합니다. 대답 날짜를 비교하는 가장 좋은 방법은 시간 스탬프입니다: $string = '11/05/2016';//string variable $date = date('Y-m-d',time());//date variable $time1 = strtotime($string); $time2 = strtotime($date); if($time1>$time2){ //do this } else{ //do this } 도움이 됐으면 좋겠어요.
나는 지금 함수를 작성하려고 시도하고 있는데, 두 날짜 사이의 일수를 계산할 수 있다.나는 현재 아래의 것을 가지고 있지만, 그것은 나의 예상치 못한 결과를 주었다. function dayCount($from, $to) { $first_date = strtotime($from); $second_date = strtotime($to); $offset = $second_date-$first_date; return floor($offset/60/60/24); } print dayCount($s, $e).' Days'; 몇몇 정확한 예: $s = '18-03-2016'; $e = '25-03-2016'; 출력: 7일-정답 $s = '03-02-2016'; $e = '06-02-2016'; 출력: 3일-정답 $s..
This question already has an answer here: comparing date and time php 2 answers 나는 세 번 데이트한 A, B 와 C 가 있다. A = 2013-08-10 10:00 B = 2013-08-10 12:00 C = 2013-08-10 10:22 C 가 A 와 B 에서 되돌아올지 여부를 확인하는 것이다.어떻게 하는지 아시는 분? 저는 운이 없어서 해봤어요. if ($time >= $date_start && $time $B)) || (($C > $A) && ($C < $B)) ){ echo "Yes '$C' is between '$A' and '$B'"; }
일년 중 제인 날부터 지금까지 php 을 어떻게 사용합니까? getdatefromday(275, 2012) 그 출력 날짜. 나도 상반된 일을 할 것이다. 예를 들면 GetDayofYear (‘2012년10월21일 ’이다. 대답 이 모든 것이 매우 쉽다.이 곳에서 datetime 대상을 읽는 createfromformat 정적 방법, 이곳의 date 함수와 이곳의 strotime 함수. // This should get you a DateTime object from the date and year. function getDateFromDay($dayOfYear, $year) { $date = DateTime::createFromFormat('z Y', strval($dayOfYear) . ' ' . st..
php 에서 이 $interval 을 어떻게 seconds 로 바 꿉 니까? 대답 하 다. 여기 에는 함수 형식 이 하나 있다.단 초 를 되 돌려 주지 않 습 니 다.이 기술 을 사용 하 는 초 수 를 획득 합 니 다. $seconds = abs($datetime1->getTimestamp()-$datetime2->getTimestamp()); 만약 당신 이 정말 $interval 을 사용 하고 싶다 면, 그것 을 계산 해 야 합 니 다. $seconds = $interval->days*86400 + $interval->h*3600 + $interval->i*60 + $interval->s; 여기 있 습 니 다. 86400 is the number of seconds in a day 3600 is the..