Show HN: Durat.io
You could bring this to a wider audience by integrating it with DuckDuckGo. You can arrange for DDG to send appropriate queries to your service with Spice [0].
If you don't want to handle the traffic, you can program an instant answer that runs on the DDG servers. Right now they have separate modules for time zone conversion [1], unit conversion [2] and uptime calculation [3]. Durat.io appears to hit a much wider set of use cases.
[0] https://duck.co/duckduckhack/spice_overview [1] https://duck.co/ia/view/timezone_converter [2] https://duck.co/ia/view/conversions [3] https://duck.co/ia/view/uptime
Author here. I built this primarily to perform time-sheet calculations and to figure out what time it is in different cities easily when talking to friends overseas.
The site is the culmination of my experimentation with parsers, and specifically my last little Java TDOP parser library bychan (https://github.com/atorstling/bychan).
Please criticize / ask any questions and/or suggest anything below.
Reminds me a little of Date::Manip, the crazy Perl date library that would actually accept strings like:
"2 weeks ago on Friday at 13:45"
"Saturday Christmas 2010 at noon"
http://search.cpan.org/~sbeck/Date-Manip-6.50/lib/Date/Manip...
Nice work. Looks like a useful tool, especially since time calculations can be confusing.
Remember to sanitize your input. http://durat.io/?q=%22/%3E%3Cscript%3Ealert(1);%3C/script%3E
Looks pretty good. Some nits:
The query "9999-99-99" throws java.time.format.DateTimeParseException (http://durat.io/?q=9999-99-99).
The query "2147483647 days + 1 day" throws java.lang.ArithmeticException (http://durat.io/?q=2147483647+days+%2B+1+day)
The query "1752-09-14 - 1752-09-02" returns PT288H, but arguably it should return PT24H (http://durat.io/?q=1752-09-14+-+1752-09-02, see also: https://en.wikipedia.org/wiki/Cal_(Unix)#Features)
Can it do anything wolframalpha.com can't?
My first try was "today + 6 weeks". Got "Lexing failed". My second try was "now + 2 hours in new york". Got "Lexing failed".
I suppose, I doesn't understand my accent ;)
undefined
undefined
I've been using Soulver on mac which does a lot of similar unit calculations, conversions etc. Works with time (but maybe not as advanced) and a lot of other things.
Ever heard about rebol?
>> now
== 13-Jul-2015/11:46:45+3:00
>> now + 4:15
== 13-Jul-2015/16:01:52+3:00
oops, i borked it: http://durat.io/?q=0%2F0
Haha, nice, good to see my old domain put to a better use :))
Does PT stands for present time?
> 8:30am + 2.5 hours = PT11H
Neat.
Great job! Well done.
The site is vulnerable to xss: http://durat.io/?q=this%20site%20is%vulnerable%20to%20XSS%3C...