Skip to content

Instantly share code, notes, and snippets.

@codemasher
Last active March 4, 2016 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codemasher/10f6e8b6cc4384ff03f4 to your computer and use it in GitHub Desktop.
Save codemasher/10f6e8b6cc4384ff03f4 to your computer and use it in GitHub Desktop.
<?php
function x(){$t=time();$f=mktime(date('H',$t),date('i',$t),date('s',$t),date('m',$t),1,date('Y',$t));$z=date('w',$f);$s=$z===0?6:$z-1;$c=date('D j M Y H:i:s', $t).chr(10);for($w=0,$y=$s*-1;$w<ceil(($s+date('t',$f))/7);$w++){$c.=date('W',$f+$w*604800).' ';for($d=0; $d<7; $d++,$y++){$c.=date('d',$f+$y*86400).' ';}$c.=chr(10);}$c.=chr(10);return $c;}echo x();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment