1
0
Fork 0
 
 
 
 
 
 
Go to file
Ambrose Chua 859c303600 Add country code 2020-11-10 19:48:59 +08:00
.github/workflows Add tests for data 2020-11-10 19:44:58 +08:00
assets Add country code 2020-11-10 19:48:59 +08:00
data Add country code 2020-11-10 19:48:59 +08:00
scripts Big change 2020-11-10 17:17:11 +08:00
templates Improve zone error message 2020-11-10 19:27:12 +08:00
third-party Version control 3rd party assets 2020-11-07 23:57:45 +08:00
.dockerignore Initial Dockerfile 2020-11-08 00:11:38 +08:00
.gitignore Initial Dockerfile 2020-11-08 00:11:38 +08:00
Dockerfile Add tzdata to deployment 2020-11-10 17:26:26 +08:00
LICENSE Create LICENSE 2020-09-27 14:03:34 +08:00
Makefile Add country code 2020-11-10 19:48:59 +08:00
NOTES.md More notes 2020-11-10 19:12:31 +08:00
README.md Minor tweak to README, add some of my notes 2020-11-10 18:42:13 +08:00
app.go Big change 2020-11-10 17:17:11 +08:00
apperror.go Split files into smaller parts 2020-11-10 19:12:15 +08:00
go.mod Add URL parser 2020-11-08 21:50:16 +08:00
go.sum Add URL parser 2020-11-08 21:50:16 +08:00
logger_development.go Big change 2020-11-10 17:17:11 +08:00
logger_production.go Logging with zap and increase modular split 2020-11-08 17:00:23 +08:00
main.go Logging with zap and increase modular split 2020-11-08 17:00:23 +08:00
mime.go Prototype data 2020-11-04 03:28:22 +08:00
mime_test.go Add zone parsing, and test code separately 2020-11-09 00:28:30 +08:00
template.go Split files into smaller parts 2020-11-10 19:12:15 +08:00
template_test.go Split files into smaller parts 2020-11-10 19:12:15 +08:00
templatehelpers.go Split files into smaller parts 2020-11-10 19:12:15 +08:00
url.go Big change 2020-11-10 17:17:11 +08:00
url_test.go Big change 2020-11-10 17:17:11 +08:00
zone.go Split files into smaller parts 2020-11-10 19:12:15 +08:00
zone_test.go Split files into smaller parts 2020-11-10 19:12:15 +08:00
zonecity.go Split files into smaller parts 2020-11-10 19:12:15 +08:00
zonecity_test.go Split files into smaller parts 2020-11-10 19:12:15 +08:00
zoneoffset.go Split files into smaller parts 2020-11-10 19:12:15 +08:00
zoneoffset_test.go Split files into smaller parts 2020-11-10 19:12:15 +08:00

README.md

datetime.link

Readable links to a point in time

Credits

Reporting Problems

File an issue on GitHub.

Rationale

Sometimes, you want to refer to a point in time, and also want to provide a timezone converter for them. datetime.link provides links to points in time and presents them in a set of selected timezones and/or local time.

Compatibility

To ensure compatibility with non-JavaScript clients, the server responds with a pure HTML page without local time. JavaScript provides the rendering of local time and local time format using the native Intl and Date APIs, eventually the Temporal API. JavaScript also provides the visual editing interface for the date, time and list of timezones to show in.

Timezone Specifiers

GeoNames data is used to generate data/cities.json, a huge 5MB JSON blob containing cities with a population greater than 15000. In the event this is not enough, more cities can be included by using the alternate cities5000.txt file.

The timezone specifiers are generated by the code in scripts/data.go, which assemble an identifier replacing non-alphanumeric and quote characters with underscores. Dashes then are used to join the city name, administrative division level 1 names and country names.

Alternatively, a fixed timezone can be specified as an offset like +08:00. This caters for scenarios where the local DST and other local time differences should not be accounted for. These are guarenteed to be stable and accurate.

Timezone Data

Go relies on local tzdata, and thus datetime.link relies on it too.

Upcoming Improvements

See Issues.