I need to parse .net TimeSpan on jQuery, I’m trying through jQuery globalization but it doesn’t working. Here is the Ajax call:
$.ajax({
context: this,
url: "Test.asmx",
success: function (msg) {
}
})
Here is some tries onSuccess:
console.log($.parseDate(msg.d.MyTimeSpam));
It prints null
console.log(msg.d.MyTimeSpam);
It prints:
Object
Days: 0
Hours: 2
Milliseconds: 0
Minutes: 0
Seconds: 0
Ticks: 72000000000
TotalDays: 0.08333333333333333
TotalHours: 2
TotalMilliseconds: 7200000
TotalMinutes: 120
TotalSeconds: 7200
__proto__: Object
I just want to print the time “02:00”
If you want to convert it to a string you could do: