Created
April 19, 2019 18:09
-
-
Save Diaskhan/25936ea91cc2e401948f15fa4295800a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertToWCFFormat(date){ | |
return "\/Date(" + date.getTime()+date.getTimezoneOffset() + ")\/"; | |
} | |
function convertToWCFFormatFromStr(date){ | |
let _date=new Date(date); | |
return "\/Date(" + _date.getTime()+_date.getTimezoneOffset() + ")\/"; | |
} | |
function converToISOFormat(dateStr){ | |
return new Date(parseInt(dateStr.substr(6))); | |
} | |
var obj=converToISOFormat("\/Date(1235764800000)\/"); | |
// 1235743200000-360 | |
console.log(obj); | |
var date = new Date('2009-02-28T02:00:00'); | |
var obj2=convertToWCFFormatFromStr(date); | |
console.log(obj2); | |
console.log(date); | |
var str = "stringify"; | |
str = str.substr(6); // ring, со 2-й позиции 4 символа | |
alert(str) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment