datetime_parse
a datetime parser write in Nim
parse datetime from various media resources
this lib using pattern match design to parse datetime from various media resources
supported format see corpus.txt
this repo also demonstrate how to write a nim module and export it as nodejs module.
Installation
for nim
nimble install datetime_parse
for js
npm install datetime_parse
or
yarn add datetime_parse
Usage
for js
const {parse} = require("datetime_parse")
const assert = require('assert');
const s ="Monday, November 25, 2019 11:22 am"
let r = parse(s)
assert.equal(r.getFullYear(),2019)
for nim
import datetime_parse
const s ="Monday, November 25, 2019 11:22 am"
let r = parse(s)
assert r.year == 2019
Development
build
nimble buildjs
Contribution
add a datetime format welcome.
test
nimble tests