Skip to main content
100%

Gist 489e9ac301a5022e6e8c60236df7e875

✓ Published0🌍 Public
Aamazingandyyy
Last edited Dec 17, 2019
Created on Dec 17, 2019

This example demonstrates how JavaScript’s built-in `Date` object can format and extract the current time in various human-readable styles, including date-only, time-only, and localized strings. It also shows a custom function that converts a 24-hour hour value to a 12-hour format with `am`/`pm` suffixes, producing a concise string like “12-17 at 2pm” alongside the full locale-specific time. The code uses native `Date` methods such as `toDateString`, `toTimeString`, `toLocaleDateString`, `toLocaleTimeString`, and getters like `getMonth`, `getDate`, and `getHours`. It relies on the browser’s or Node.js’s JavaScript runtime without external libraries.

AI-generated description

Similar vizzes

Loading thumbnail…

List of all JavaScript timezones (date.toString()) on linux node.js

This visualization lists every JavaScript timezone on a Linux node.js system, displaying the output of date.toString() for each zoneinfo file. For each timezone, it shows the local date and time for January 1, 2014 and September 1, 2014, including the GMT offset and abbreviated timezone name. The data highlights differences between winter and summer time, revealing which zones observe daylight saving time. For example, Pacific/Auckland shifts from GMT+1300 (NZDT) in January to GMT+1200 (NZST) in September, while Pacific/Chatham changes from GMT+1345 (CHADT) to GMT+1245 (CHAST). The example uses the node.js runtime on Linux to enumerate and display the output of date.toString() for every timezone in the system's zoneinfo database.**List of all JavaScript timezones (date.toString()) on linux node.js** This visualization enumerates all timezones available in a Linux Node.js environment by running `date.toString()` for two fixed dates—January 1, 2014 and September 1, 2014—on each zone. Each entry shows the zone name followed by the resulting JavaScript date string, revealing the UTC offset and abbreviated timezone label. The side-by-side comparison of January and September outputs highlights seasonal changes, exposing daylight-saving transitions (e.g., Pacific/Auckland shifts from GMT+1300 NZDT to GMT+1200 NZST) as well as zones with constant offsets. The list is generated from the system’s /usr/share/zoneinfo database, making it a comprehensive reference for how Node.js formats timezone names and offsets on Linux. A gist by abonello.

Aabonello
67% match