ComenzarEmpieza gratis

Formatting dates with FORMAT()

The FORMAT() function allows for additional flexibility in building dates. It takes in three parameters: the input value, the input format, and an optional culture (such as en-US for US English or zh-cn for Simplified Chinese).

In the following exercises, we will investigate three separate methods for formatting dates using the FORMAT() function against the day that Python 3 became generally available: December 3rd, 2008.

Este ejercicio forma parte del curso

Time Series Analysis in SQL Server

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

DECLARE
	@Python3ReleaseDate DATETIME2(3) = '2008-12-03 19:45:00.033';

SELECT
	-- Fill in the function call and format parameter
	___(@Python3ReleaseDate, ___, 'en-US') AS US_d,
	___(@Python3ReleaseDate, ___, 'de-DE') AS DE_d,
	-- Fill in the locale for Japan
	___(@Python3ReleaseDate, ___, ___) AS JP_d,
	___(@Python3ReleaseDate, ___, 'zh-cn') AS CN_d;
Editar y ejecutar código