public static function ToDateTime( $value, $provider = null )
	{
		if ( $value instanceof \DateTime ) return $value;

		if ( is_string( $value ) )
		{
			$timestamp = strtotime( $value );

			if ( $timestamp === false ) return null;

			/**
			 * @var \DateTime $dt
			 */
			$dt = new \DateTime();
			$dt->setTimestamp( $timestamp );

			return $dt;
		}

		$value = Convert::ToInt( $value, $provider );
		if ( is_null( $value ) ) return null;

		$dt = new \DateTime();
		$dt->setTimestamp( $value );

		return $dt;
	}