convert date to mm/dd/yyyy sql as string code example
Example 1: sql convert date to string yyyy-mm-dd
select CONVERT(char(10), GetDate(),126)
/* 2020-12-23 */
Example 2: Convert a date to yyyy mm dd format
const formatYmd = date => date.toISOString().slice(0, 10);
formatYmd(new Date());