I have a C# application that return in JSON an expiration date of an authentication token like this:
"expirationDate":"Fri, 27 Mar 2015 09:12:45 GMT"
In my TypeScript I check that the date is still valid here:
isAuthenticationExpired = [expirationDate: string]: boolean => {
var now = new Date[].valueOf[];
var exp: any = Date.parse[expirationDate].valueOf[];
return exp - now