Tags: PHP
I've been meaning to stick these in here. Here are a few of useful helper functions I used in the most recent project; it had to do with displaying lots of dates, so these came in really handy.
function timestamp_to_year ($timestamp){
return date('Y', $timestamp);
}
function timestamp_to_month ($timestamp){
return date('m', $timestamp);
}
function month_number_to_name ($monthNum){
$monthName = date('F', mktime(0, 0, 0, $monthNum, 10));
return $monthName;
}
©2023, kirillsimin.com