public static function getTimeago($date) {

		$app = Application::getInstance();
		
		// create DateTime object with int or strings
		if (is_int($date)) {
			$dateTime = new \DateTime();
			$dateTime->setTimestamp($dateTime);
			$dateTime->setTimezone($app->currentUser->getDateTimeZone());
		} else if (is_string($date)) {
			if (0!==strpos($date, '0000-00-00 00:00:00')) {
				$dateTime = new \DateTime($date);
				$dateTime->setTimezone($app->currentUser->getDateTimeZone());
			} else {
				$dateTime = NULL;
			}
		} else if (is_a($date,'DateTime')) {
			$dateTime = $date;
			$dateTime->setTimezone($app->currentUser->getDateTimeZone());
		} else {
			$dateTime = NULL;
		}
		
		// if date valid, create the expected object
		if (is_a($dateTime,'DateTime')) {
			
			$tran = Translator::getInstance();
		
			// if is set a locale date format, use it
			if ($tran->stringExists('LC_DATETIME_FORMAT')) {

				$localeTimestamp = $dateTime->getTimestamp();
				
				// add offset in case of UTC_DATE use
				if (defined('UTC_DATE') and UTC_DATE) {
					$localeTimestamp += $dateTime->getOffset();
				}
				
				$humanDate = strftime(Translator::do('LC_DATETIME_FORMAT'), $localeTimestamp);
			
			// otherwise choose another format
			} else {
					
				$format = $tran->stringExists('DATETIME_FORMAT') ? Translator::do('DATETIME_FORMAT') : 'Y-m-d H:i:s';
				$humanDate = $dateTime->format($format);
					
			}
			
			return '<span class="timeago" title="' . $dateTime->format(DATE_W3C) . '">' . $humanDate . '</span>';

		// otherwise return n.a. date
		} else {

			return '<span class="timeago">' . Translator::do('NOT_AVAILABLE') . '</span>';

		}

	}
public static function getTimeago($date) {

		$app = Application::getInstance();
		
		// create DateTime object with int or strings
		if (is_int($date)) {
			$dateTime = new \DateTime();
			$dateTime->setTimestamp($dateTime);
			$dateTime->setTimezone($app->currentUser->getDateTimeZone());
		} else if (is_string($date)) {
			if (0!==strpos($date, '0000-00-00 00:00:00')) {
				$dateTime = new \DateTime($date);
				$dateTime->setTimezone($app->currentUser->getDateTimeZone());
			} else {
				$dateTime = NULL;
			}
		} else if (is_a($date,'DateTime')) {
			$dateTime = $date;
			$dateTime->setTimezone($app->currentUser->getDateTimeZone());
		} else {
			$dateTime = NULL;
		}
		
		// if date valid, create the expected object
		if (is_a($dateTime,'DateTime')) {
			
			$tran = Translator::getInstance();
		
			// if is set a locale date format, use it
			if ($tran->stringExists('LC_DATETIME_FORMAT')) {

				$localeTimestamp = $dateTime->getTimestamp();
				
				// add offset in case of UTC_DATE use
				if (defined('UTC_DATE') and UTC_DATE) {
					$localeTimestamp += $dateTime->getOffset();
				}
				
				$humanDate = strftime(Translator::do('LC_DATETIME_FORMAT'), $localeTimestamp);
			
			// otherwise choose another format
			} else {
					
				$format = $tran->stringExists('DATETIME_FORMAT') ? Translator::do('DATETIME_FORMAT') : 'Y-m-d H:i:s';
				$humanDate = $dateTime->format($format);
					
			}
			
			return '<span class="timeago" title="' . $dateTime->format(DATE_W3C) . '">' . $humanDate . '</span>';

		// otherwise return n.a. date
		} else {

			return '<span class="timeago">' . Translator::do('NOT_AVAILABLE') . '</span>';

		}

	}
public static function getTimeago ( $ date ) { $ app = Application :: getInstance ( ) ; // create DateTime object with int or strings
 if ( is_int ( $ date ) ) { $ dateTime = new \ DateTime ( ) ; $ dateTime -> setTimestamp ( $ dateTime ) ; $ dateTime -> setTimezone ( $ app -> currentUser -> getDateTimeZone ( ) ) ; } else if ( is_string ( $ date ) ) { if ( 0 !== strpos ( $ date , '0000-00-00 00:00:00' ) ) { $ dateTime = new \ DateTime ( $ date ) ; $ dateTime -> setTimezone ( $ app -> currentUser -> getDateTimeZone ( ) ) ; } else { $ dateTime = NULL ; } } else if ( is_a ( $ date , 'DateTime' ) ) { $ dateTime = $ date ; $ dateTime -> setTimezone ( $ app -> currentUser -> getDateTimeZone ( ) ) ; } else { $ dateTime = NULL ; } // if date valid, create the expected object
 if ( is_a ( $ dateTime , 'DateTime' ) ) { $ tran = Translator :: getInstance ( ) ; // if is set a locale date format, use it
 if ( $ tran -> stringExists ( 'LC_DATETIME_FORMAT' ) ) { $ localeTimestamp = $ dateTime -> getTimestamp ( ) ; // add offset in case of UTC_DATE use
 if ( defined ( 'UTC_DATE' ) and UTC_DATE ) { $ localeTimestamp += $ dateTime -> getOffset ( ) ; } $ humanDate = strftime ( Translator :: do ( 'LC_DATETIME_FORMAT' ) , $ localeTimestamp ) ; // otherwise choose another format
 } else { $ format = $ tran -> stringExists ( 'DATETIME_FORMAT' ) ? Translator :: do ( 'DATETIME_FORMAT' ) : 'Y-m-d H:i:s' ; $ humanDate = $ dateTime -> format ( $ format ) ; } return '<span class="timeago" title="' . $ dateTime -> format ( DATE_W3C ) . '">' . $ humanDate . '</span>' ; // otherwise return n.a. date
 } else { return '<span class="timeago">' . Translator :: do ( 'NOT_AVAILABLE' ) . '</span>' ; } }
Will returns a div tag with timeago content.

@param	mixed	DateTime, integer-timestamp or string date.

@return	string
Will returns a div tag with timeago content .