d3.time.format localization
✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Aug 9, 2012
A clock displays the current time in Russian, updating every second. The example demonstrates locale-specific formatting in d3.time.format, using the `%c` directive to render a localized date and time string. The page uses d3.v2.min.js with the `d3.select` API to update an HTML `h1` element. The D3 library is built with the `ru_RU` locale, which changes the output of `d3.time.format`. An animation, driven by `setInterval`, refreshes the displayed time at a one-second interval.
AI-generated descriptionD3 2.10 adds support for static localization of d3.time.format. When building D3, specify the LOCALE environment variable. For example, to build a version of D3 for Russian:
LOCALE=ru_RU make clean all
gpl-3.0 Licensed