current week number code example
Example 1: get current week number
<?php
$ddate = "2012-10-18";
$date = new DateTime($ddate);
$week = $date->format("W");
echo "Weeknummer: $week";
Example 2: day to week
var d = 1 // Amount of days
console.log(d/7) // Logs amount of weeks