b10068750833f3379f7816c1d4da940bd6b0623a
[platform/framework/web/crosswalk-tizen.git] /
1 var timezoneOffset = require('./timezoneOffset');
2
3     /**
4      * Abbreviated time zone name or similar information.
5      */
6     function timezoneAbbr(date){
7         // Date.toString gives different results depending on the
8         // browser/system so we fallback to timezone offset
9         // chrome: 'Mon Apr 08 2013 09:02:04 GMT-0300 (BRT)'
10         // IE: 'Mon Apr 8 09:02:04 UTC-0300 2013'
11         var tz = /\(([A-Z]{3,4})\)/.exec(date.toString());
12         return tz? tz[1] : timezoneOffset(date);
13     }
14
15     module.exports = timezoneAbbr;
16
17