GithubHelp home page GithubHelp logo

naritta / mruby-fast-strptime Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 16 KB

mruby implementation of https://github.com/nurse/strptime

License: BSD 2-Clause "Simplified" License

Ruby 30.85% C 69.15%

mruby-fast-strptime's People

Contributors

naritta avatar tagomoris avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

tagomoris

mruby-fast-strptime's Issues

No guard about invalid format (No check about unmatched pattern)

This library provides no protection about unmatched pattern - so we will get wrong result if we wrote invalid time pattern (and it's very hard to find the root cause).

With wrong time format (N instead of %N here), naruse/strptime reports unmatched pattern:

$ ruby -rstrptime -e 'p Strptime.new("%Y-%m-%d %H:%M:%S.N %z").exec("2017-10-06 13:15:30.0 +00:00")'
-e:1:in `exec': string doesn't match (ArgumentError)
	from -e:1:in `<main>'

But this library returns a surprising time value:

$ mruby -e 'p Strptime.new("%Y-%m-%d %H:%M:%S.N %z").exec("2017-10-06 13:15:30.0 +00:00")'
Sun Mar 15 17:53:20 4444257

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.