I have date string like Fri, 15 Nov 2013 09:00:00 -0600
in JavaScript(sent by server PHP). I need to parse this and get the timezone offset '-0600'.
Is there any easy way to get the timezone offset from this string?
Thanks
var str = "Fri, 15 Nov 2013 09:00:00 -0600"
var output = str.split(' ').pop();
var reg_exp = /(-|\+)\d{4}/,
timezone_offset = reg_exp.match("Fri, 15 Nov 2013 09:00:00 -0600")[0];
Date.parse()
in conjunction withDate.getTimezoneOffset()
?