datetime_parse

parse datetime from various media resources write in Nim


Keywords
datetime, parser
License
MIT
Install
npm install datetime_parse@1.0.0

Documentation

datetime_parse Npm Version npm: total downloads

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