SQL Server konvertieren die Zeichenfolge bisher
select Cast( '2021-09-22' as date ) as castedDate;
select convert(date,'20210922') as convertedDate;
MzanziLegend
select Cast( '2021-09-22' as date ) as castedDate;
select convert(date,'20210922') as convertedDate;
SELECT FORMAT(dbo.column, 'M/dd/yyyy')
var date= new Date(`2017-11-09T05:36:00.834Z`);
var dd = date.getDate();
var mm = date.getMonth()+1; //January is 0!
var yyyy = date.getFullYear();
if(dd<10){
dd='0'+dd;
}
if(mm<10){
mm='0'+mm;
}
var date= dd+'/'+mm+'/'+yyyy;
console.log(date);//it logs "09/11/2017"
var formattedDate = "2017-11-09T05:36:00.834Z"
var result = formattedDate.replace(/^(\d{4})-(\d{2})-(\d{2}).*$/, "$3/$2/$1");
console.log (result);
Run code snippetHide results