Skip to content

Instantly share code, notes, and snippets.

@matoakley
Created April 19, 2011 15:36
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 matoakley/928485 to your computer and use it in GitHub Desktop.
Save matoakley/928485 to your computer and use it in GitHub Desktop.
Extend Kohana's Date helper to return month given as integer to string
<?php defined('SYSPATH') or die('No direct script access.');
class Date extends Kohana_Date
{
/**
* Take a numerical representation of a month (e.g. '04') and return it as a human readable string (e.g. 'April')
*
* @param mixed numerical representation of month
* @return string
*/
public static function month2string($month)
{
return date('F', mktime(0, 0, 0, $month, 1, date('Y')));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment