Check out example codes for "sql server format date". It will help you in understanding the concepts better.

Code Example 1

DECLARE @v DATE= '3/15/2013'

SELECT CONVERT(VARCHAR(8), @v, 112)

Code Example 2

SELECT DATE_FORMAT("2017-06-15", "%Y");

Code Example 3

convert (varchar , getdate()-1 , 112)

Learn ReactJs, React Native from akashmittal.com