mktime
Get week number (in the year) from a date PHP
Today, using PHP’s DateTime objects is better: <?php $ddate = “2012-10-18”; $date = new DateTime($ddate); $week = $date->format(“W”); echo “Weeknummer: $week”; It’s because in mktime(), it goes like this: mktime(hour, minute, second, month, day, year); Hence, your order is wrong. <?php $ddate = “2012-10-18”; $duedt = explode(“-“, $ddate); $date = mktime(0, 0, 0, $duedt[1], $duedt[2], … Read more
PHP convert date format dd/mm/yyyy => yyyy-mm-dd [duplicate]
Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed. Check more here. Use the … Read more