diff --git a/README.md b/README.md index 3793a5d..cb8ef1d 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,8 @@ ## The Systeminformation Project -This is amazing. Started as a small project just for myself, it now has > 17,000 -lines of code, > 650 versions published, up to 8 mio downloads per month, > 350 +This is amazing. Started as a small project just for myself, it now has > 18,000 +lines of code, > 700 versions published, up to 9 mio downloads per month, > 380 mio downloads overall. Top 10 NPM ranking for backend packages. Thank you to all who contributed to this project! diff --git a/docs/index.html b/docs/index.html index c82d8ba..30a53e6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -204,7 +204,7 @@
-
18,504
+
18,542
Lines of code
@@ -212,7 +212,7 @@
Downloads last month
-
865
+
867
Dependents
diff --git a/lib/osinfo.js b/lib/osinfo.js index 5e84edf..e4274de 100644 --- a/lib/osinfo.js +++ b/lib/osinfo.js @@ -34,11 +34,17 @@ const _sunos = (_platform === 'sunos'); function time() { let t = new Date().toString().split(' '); + let timezoneName = ''; + try { + timezoneName = Intl.DateTimeFormat().resolvedOptions().timeZone; + } catch { + timezoneName = (t.length >= 7) ? t.slice(6).join(' ').replace(/\(/g, '').replace(/\)/g, '') : ''; + } const result = { current: Date.now(), uptime: os.uptime(), timezone: (t.length >= 7) ? t[5] : '', - timezoneName: Intl ? Intl.DateTimeFormat().resolvedOptions().timeZone : (t.length >= 7) ? t.slice(6).join(' ').replace(/\(/g, '').replace(/\)/g, '') : '' + timezoneName }; if (_darwin || _linux) { try {