There was a style of formatting dates in the USSR, which can now be found, perhaps, only on tombstones (that’s where the road goes). First the first two digits of the year, then the fraction by number / Roman month, then the second two digits of the year.
Task: as readable as possible and cross-browser format the date specified in Unix-format. Should work on standard libraries. The amount of code does not care, very concerned about matches, I mean, the speed of work.
My version. I do not like that the width of the number of days is not tracked. Hence the imperfect alignment:
function rus1960($time){ $year = date('Y',$time); $month = rome(date('n',$time)); $day = date('j',$time); $year = str_split($year,2); $day = '<span style="font-size: 0.5em; text-decoration: underline; vertical-align: top">'.$day.'</span>'; $month = '<span style="font-size: 0.5em; margin-left: -1.1em;">'.$month.'</span>'; return $year[0].$day.$month.$year[1]; } function rome($N){ $c='IVXLCDM'; for($a=5,$b=$s='';$N;$b++,$a^=7) for($o=$N%$a,$N=$N/$a^0;$o--;$s=$c[$o>2?$b+$N-($N&=-2)+$o=1:$b].$s); return $s; }
PS At the same time present a new tag