<commit_before><?php namespace Core;
/**
 * Date helper
 ** 
 *
 * @package		ClanCatsFramework
 * @author		<NAME> <<EMAIL>>
 * @version		2.0
 * @copyright 	2010 - 2014 ClanCats GmbH
 *
 */
class CCDate 
{
	/**
	 * Get minutes in seconds
	 *
	 * @param int		$minutes
	 * @return int 
	 */
	public static function minutes( $minutes )
	{
		return $minutes * 60;
	}
	
	/**
	 * Get hours in seconds
	 *
	 * @param int		$hours
	 * @return int 
	 */
	public static function hours( $hours )
	{
		return $hours * 60 * 60;
	}
	
	/**
	 * Get days in seconds
	 *
	 * @param int		$days
	 * @return int 
	 */
	public static function days( $days )
	{
		return $days * 60 * 60 * 24;
	}
	
	/**
	 * Get weeks in seconds
	 *
	 * @param int		$weeks
	 * @return int 
	 */
	public static function weeks( $weeks )
	{
		return $weeks * 60 * 60 * 24 * 7;
	}
	
	/**
	 * Get months in seconds
	 *
	 * @param int		$months365
	 * @return int 
	 */
	public static function months( $months )
	{
		return $months * 60 * 60 * 24 * 30.4368;
	}
	
	/**
	 * Get years in seconds
	 *
	 * @param int		$years
	 * @return int 
	 */
	public static function years( $years )
	{
		return $years * 60 * 60 * 24 * 365;
	}
	
	/**
	 * format the date
	 */
	public static function format( $time, $format = 'j F Y \a\t G:i' ) {
		return date( $format, $time );  
	}
	
	/**
	 * format a date without time
	 */
	public static function format_date( $date, $format = 'j F Y' ) {
		return date( $format, strtotime( $date ) ); 
	}
	
	/**
	 * to string relative string
	 *
	 * @param int	$ts
	 * @return string
	 */
	public static function relative($ts)
	{
		if(!ctype_digit($ts))
			$ts = strtotime($ts);
	
		$diff = time() - $ts;
		if($diff == 0)
			return __('core::common.date.now');
		elseif($diff > 0)<commit_msg>default date format<commit_after><?php namespace Core;
/**
 * Date helper
 ** 
 *
 * @package		ClanCatsFramework
 * @author		<NAME> <<EMAIL>>
 * @version		2.0
 * @copyright 	2010 - 2014 ClanCats GmbH
 *
 */
class CCDate 
{
	/**
	 * Get minutes in seconds
	 *
	 * @param int		$minutes
	 * @return int 
	 */
	public static function minutes( $minutes )
	{
		return $minutes * 60;
	}
	
	/**
	 * Get hours in seconds
	 *
	 * @param int		$hours
	 * @return int 
	 */
	public static function hours( $hours )
	{
		return $hours * 60 * 60;
	}
	
	/**
	 * Get days in seconds
	 *
	 * @param int		$days
	 * @return int 
	 */
	public static function days( $days )
	{
		return $days * 60 * 60 * 24;
	}
	
	/**
	 * Get weeks in seconds
	 *
	 * @param int		$weeks
	 * @return int 
	 */
	public static function weeks( $weeks )
	{
		return $weeks * 60 * 60 * 24 * 7;
	}
	
	/**
	 * Get months in seconds
	 *
	 * @param int		$months365
	 * @return int 
	 */
	public static function months( $months )
	{
		return $months * 60 * 60 * 24 * 30.4368;
	}
	
	/**
	 * Get years in seconds
	 *
	 * @param int		$years
	 * @return int 
	 */
	public static function years( $years )
	{
		return $years * 60 * 60 * 24 * 365;
	}
	
	/**
	 * format the date
	 */
	public static function format( $time, $format = 'd.m.Y  G:i' ) {
		return date( $format, $time );  
	}
	
	/**
	 * format a date without time
	 */
	public static function format_date( $date, $format = 'd.m.Y' ) {
		return date( $format, strtotime( $date ) ); 
	}
	
	/**
	 * to string relative string
	 *
	 * @param int	$ts
	 * @return string
	 */
	public static function relative($ts)
	{
		if(!ctype_digit($ts))
			$ts = strtotime($ts);
	
		$diff = time() - $ts;
		if($diff == 0)
			return __('core::common.date.now');
		elseif($diff > 0)
{'fraction_non_alphanumeric': 0.15266742338251987, 'fraction_numerical': 0.031214528944381384, 'mean_word_length': 2.3603431839847473, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5249801', 'n_tokens_mistral': 1538, 'n_tokens_neox': 1244, 'n_words': 386}