6 ms·
Show HN: Durat.io
- empressplay 11y agoNeat.
- kozhevnikov 11y agoCan it do anything wolframalpha.com can't?
- DiabloD3 11y agoI came here to say this. I use WA for all my time calculations.
- strictfp 11y agoWell, I'm not sure. I aimed at getting better than google calculator. But hopefully durat.io is quicker. Any requests are welcome! edit: After doing some quick testing, Wolfram doesn't seem very good at time zone conversions or time span conversions.
- mapcars 11y agoEver heard about rebol? >> now == 13-Jul-2015/11:46:45+3:00 >> now + 4:15 == 13-Jul-2015/16:01:52+3:00
- cbhl 11y agoLooks pretty good. Some nits: The query "9999-99-99" throws java.time.format.DateTimeParseException (http://durat.io/?q=9999-99-99 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 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 http://durat.io/?q=1752-09-14+-+1752-09-02, see also: https://en.wikipedia.org/wiki/Cal_(Unix)#Features https://en.wikipedia.org/wiki/Cal_(Unix)#Features)
- strictfp 11y agoThanks for the QA! I haven't put all to much time into weeding out all the bugs yet. If the site gets popular that will definitely change. edit: The first bug is a showstopper. Everything is supposed to be a bigint, so this will be fixed ASAP. The second one I will catch and print a nicer error for. The third one I will have to look into. I probably perform the calculation incorrectly by using the wrong temporal types. Thanks again.
- JoshTriplett 11y agoThe third one is the hardest to deal with: ~$ cal 9 1752 September 1752 Su Mo Tu We Th Fr Sa 1 2 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 This isn't the only bit of craziness you'd need to deal with if you wanted to handle historical times perfectly. For instance, consider attempting to get an accurate duration in hours of a time that extends across the daylight savings time switchover, historically, in a region where that has changed from year to year. Another interesting one: 2015-07-01 - 2015-06-29 returns "PT48H", but it should be 48 hours and 1 second.
- strictfp 11y agoI'm currently passing on all the date calculations to the java.time API, so at least I won't have to do it all on my own. But it's sometimes a challenge to even pass it down the right way will all the different use-cases and temporal types available.
- haberman 11y agoReminds 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/Date.pod http://search.cpan.org/~sbeck/Date-Manip-6.50/lib/Date/Manip...
- strictfp 11y agoAuthor 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 https://github.com/atorstling/bychan). Please criticize / ask any questions and/or suggest anything below.
- acqq 11y agoLooks OK. Now looking at the examples, the answer for "now in zone Lisbon" gives 2015-07-13T13:31:47.968+01:00[Europe/Lisbon] Why not just "today, 14:31:47, Lisbon"? If I enter the expression I don't actually like receiving the expression as the answer. Also, the whole "expression" of the translation of the question is displayed, when most probably the user doesn't need it every time, and then it's initially confusing.
- strictfp 11y agoThanks for your feedback. I agree that the representation is suboptimal. I will work on this if there is interest in the site. Regarding the ast representation, I will think about making it optional.
- virgoerns 11y agohttps://xkcd.com/1179/ https://xkcd.com/1179/ BTW: what does "today" mean when your wall clock shows e.g. 23:25:00? Is it "today in Lisbon" or "today at your timezone"?
- deleted 11y ago[deleted]
- sprain 11y agoMy 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 ;)
- strictfp 11y agoMy NLP is not top notch :D. I figured that getting the parsing intuitive would be doable given the relatively narrow field, but I was proven wrong :) The result is that you need to learn the syntax a bit before it feels intuitive. Regarding your specific examples: You need "in _zone_ new york" ATM. I think 'weeks' is missing simply as the result of an oversight :/ Thanks for the QA.
- deleted 11y ago[deleted]
- przemoc 11y agoIf you're *nix user, you can quite easily perform this kind of stuff using date, or at least using date from coreutils. $ date -d 'today + 6 weeks' Mon Aug 24 13:15:54 CEST 2015 $ TZ=America/New_York date -d 'now + 2 hours' Mon Jul 13 09:16:17 EDT 2015
- strictfp 11y agoI had no idea. Great tip, thanks!
- ochronus 11y agoHaha, nice, good to see my old domain put to a better use :))
- strictfp 11y agoWhat a coincidence! I spent a _lot_ of time trying to find some time-related domain name which wasn't taken. What were you using it for?
- ysr23 11y agooops, i borked it: http://durat.io/?q=0%2F0 http://durat.io/?q=0%2F0
- strictfp 11y agoNicely done! At least you didn't try to paste half of wikipedia into the input field as my nice collegue did :)
- david927 11y agoGreat job! Well done.
- ejcx 11y agoNice 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 http://durat.io/?q=%22/%3E%3Cscript%3Ealert(1);%3C/script%3E
- strictfp 11y agoPoor little Bobby Tables can't register :D Thanks
- edraferi 11y agoYou 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 https://duck.co/duckduckhack/spice_overview [1] https://duck.co/ia/view/timezone_converter https://duck.co/ia/view/timezone_converter [2] https://duck.co/ia/view/conversions https://duck.co/ia/view/conversions [3] https://duck.co/ia/view/uptime https://duck.co/ia/view/uptime
- strictfp 11y agoThis is a great idea! Thanks!
- magnusstubman 11y agoThe site is vulnerable to xss: http://durat.io/?q=this%20site%20is%vulnerable%20to%20XSS%3Cscript%3Ealert(%27xss%27);%3C/script%3E http://durat.io/?q=this%20site%20is%vulnerable%20to%20XSS%3C...
- deleted 11y ago[deleted]
- jastanton 11y agoDoes PT stands for present time? > 8:30am + 2.5 hours = PT11H
- strictfp 11y agoNope, it's https://en.wikipedia.org/wiki/ISO_8601 https://en.wikipedia.org/wiki/ISO_8601 for 11 hours. Try "8:30 am today + 2.5 hours".
- funerr 11y agoXSS? http://durat.io/?q=%22%20/%3E%3Cscript%3Ealert(1)%3C/script%3E http://durat.io/?q=%22%20/%3E%3Cscript%3Ealert(1)%3C/script%...
- strictfp 11y agoYes, will be fixed.
- mtourne 11y agoI'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.