Date'ish conversion
Moderator: General Moderators
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
Date'ish conversion
Is there an easy way to transform date of "Y:z"-format (Today would be (2006:294) to a normal date?
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
Wasnt so complicated, but for some reason you need to add one day.
Code: Select all
# From format "Yz"
function tdate($time){
$y = substr($time,0,4);
$d = substr($time,4,3);
return date("Y-m-d", mktime(0,0,0,1,$d+1,$y));
}