public function dateFormatted( $first = null, $second = null, $lang = null ) {
		// One argument or less
		if ( $second === null ) {
			// No arguments
			if ( $first === null ) {
				$format = $this->msg( 'dateformat', 'general' );
				$timestamp = time();

			// Timestamp only
			} elseif ( is_int( $first ) ) {
				$format = $this->msg( 'dateformat', 'general' );
				$timestamp = $first;

			// Date string only
			} elseif ( strtotime( $first ) ) {
				$format = $this->msg( 'dateformat', 'general' );
				$timestamp = strtotime( $first );

			// Format only
			} else {
				$format = $first;
				$timestamp = time();
			}

		// Two arguments
		} else {
			$format = $first;
			$timestamp = is_int( $second ) ? $second : strtotime( $second );
		}

		// Save current setlocale
		$saved = setlocale( LC_ALL, 0 );

		// Overwrite for current language
		setlocale( LC_ALL, $this->getLocale( $lang ) );
		$return = strftime( $format, $timestamp );

		// Reset back to what it was
		setlocale( LC_ALL, $saved );

		return $return;
	}
public function dateFormatted( $first = null, $second = null, $lang = null ) {
		// One argument or less
		if ( $second === null ) {
			// No arguments
			if ( $first === null ) {
				$format = $this->msg( 'dateformat', 'general' );
				$timestamp = time();

			// Timestamp only
			} elseif ( is_int( $first ) ) {
				$format = $this->msg( 'dateformat', 'general' );
				$timestamp = $first;

			// Date string only
			} elseif ( strtotime( $first ) ) {
				$format = $this->msg( 'dateformat', 'general' );
				$timestamp = strtotime( $first );

			// Format only
			} else {
				$format = $first;
				$timestamp = time();
			}

		// Two arguments
		} else {
			$format = $first;
			$timestamp = is_int( $second ) ? $second : strtotime( $second );
		}

		// Save current setlocale
		$saved = setlocale( LC_ALL, 0 );

		// Overwrite for current language
		setlocale( LC_ALL, $this->getLocale( $lang ) );
		$return = strftime( $format, $timestamp );

		// Reset back to what it was
		setlocale( LC_ALL, $saved );

		return $return;
	}
public function dateFormatted ( $ first = null , $ second = null , $ lang = null ) { // One argument or less if ( $ second === null ) { // No arguments if ( $ first === null ) { $ format = $ this -> msg ( 'dateformat' , 'general' ) ; $ timestamp = time ( ) ; // Timestamp only } elseif ( is_int ( $ first ) ) { $ format = $ this -> msg ( 'dateformat' , 'general' ) ; $ timestamp = $ first ; // Date string only } elseif ( strtotime ( $ first ) ) { $ format = $ this -> msg ( 'dateformat' , 'general' ) ; $ timestamp = strtotime ( $ first ) ; // Format only } else { $ format = $ first ; $ timestamp = time ( ) ; } // Two arguments } else { $ format = $ first ; $ timestamp = is_int ( $ second ) ? $ second : strtotime ( $ second ) ; } // Save current setlocale $ saved = setlocale ( LC_ALL , 0 ) ; // Overwrite for current language setlocale ( LC_ALL , $ this -> getLocale ( $ lang ) ) ; $ return = strftime ( $ format , $ timestamp ) ; // Reset back to what it was setlocale ( LC_ALL , $ saved ) ; return $ return ; }
Get a localized date. Pass a format, time or both.
Defaults to the current timestamp in the language's default date format.

@param string|null $first Date format compatible with strftime()
@param mixed|null $second Timestamp (seconds since unix epoch) or string (ie. "2011-12-31")
@param string|null $lang Language code. Defaults to current langauge (through getLocale() )
@return string
Get a localized date . Pass a format time or both . Defaults to the current timestamp in the language s default date format .