php convert a date to a timestamp
问题 I'm trying to convert 2 dates to timestamps. One is generated by php (today's date) and the other is input by the user $today = date("d-m-y"); // 01-12-13 $start_date = "28-11-13"; $todaytimestamp = strtotime($today); $starttimestamp = strtotime($start_date); echo "$today > $start_date <br>$todaytimestamp > $starttimestamp"; Problem is that the result are incorrect Result: 01-12-13 > 28-11-13 1008201600 > 1857686400 what's wrong ? 回答1: Always use four-digit years, as using two-digit years