I've made small timezone converter according to https://duckduckhack.uservoice.com/forums/5168-plugins/suggestions/3066692-timezone-converter. I hope you like it.
Remove Time::Piece that I'm not using.
Very cool! I've made theses queries countless times myself. I'm taking a look at it right now. Thanks!
I've got it up and running on dylan.duckduckgo.com - check it out! I've merged this goodie into our repository because I think it is already very helpful; we're excited to deploy it. However, I have noticed an irregularity between the parsing of queries with "in" as opposed to "into" triggers. An example of this is https://dylan.duckduckgo.com/?q=10%3A00PM+pst+into+est, which does not trigger with "10:00pm pst to est". Do you have any idea what could be causing this problem?
Add "TO" as alias for "INTO".
Everything was as intended - in and into were keywords to activate this. But I guess that could be issue, so I've added to to keywords.
Don't allow silly timezones like GMT+31421858231489.
Cool! Thanks for getting back to us quickly. One more issue pointed out by @rpicard is preservation of the original query. An example of this is the query "10:00PM PST" which is converted to 24 hour format before display with the new information. We try to keep the original formatting of the users query whenever possible for clarity.
Use AM/PM style when input uses it.
One minor suggestion would be to print out the the full name of the time zone being converted.
1pm pst to HST
1pm pst to HST
< convert from ??? ???? Time to Hawaii standard time
< 1:00 P.M. (PST, UTC+8) is 7:00 P.M., 1 day prior (HST, UTC-10).
I put in the ??? ??? above what I wanted was Pacific time (utc-8) but got utc+8 and hence having the full name printed out would possible avoid confusion of similar time zones that can be confused. In this case I think it might actually be giving me the wrong time zone since I'm only aware of one PST time zone and it is UTC-8.
@mihugo: That definitely would be possible. I like table of timezones in the code, but I guess I could make it way more ugly to do that. I'll make pull request when it'll be ready. As for PST, it would be Philippine Standard Time, but it should be Pacific Standard Time (way more common) - oops.
Just confirming that it now gives pacific time instead of Philippine time. You also were very quick. Nice to report a issue and have it fixed so fast. A huge difference from my day job where small fixes like this take weeks of review and panic.
If you do print out the full name of the time zone it might be also nice to put the first line it a plan text format such as
< 1 pm. Pacific Standard time (PST,UTC-8) is 10 am. Hawaii Standard Time (HST, UTC-10)
or perhaps 2 lines
< 1:00 p.m. Pacific Standard time is 10:00 a.m. Hawaii Standard Time
< 1:00 p.m. (PST, UTC+8) is 7:00 p.m., 1 day prior (HST, UTC-10)
I'm having arguments with myself on what looks the best and hence am just throwing out suggestions.
Also to be picky looking around the web it appears that the more common style way of writing the morning and afternoon is to use small characters and not caps but then again there are some style guides that like it the way you have it written. It is fine the way you have it as well. http://www.businesswritingblog.com/business_writing/2009/06/what-is-the-correct-time-am-pm-am-pm-am-pm-.html
Another minor suggestion.
Doing a conversion such as "9 am pst to est" provides an output of 0:00 P.M. Ideally it would be nice to print "noon" and midnight instead of the a.m./p.m. in these cases since the definitions of a.m. and p.m. are not defined for the crossover points. If you really wanted to get fancy you might also recognize an input of noon.
Also, thanks for reporting issues, but I've feeling it would be more organized if you would use new issues for those :-). This issue was about adding the feature (which was already done). New issues are free, so feel free to open those next time. The bug tracker is really easy to use, just click "New issue" and describe it - it's probably easiest bug tracker I've ever seen.
Also, well, goodies are plugins - as long you don't touch anything that isn't goodie or test for goodie, usually merges are quick.
Merge branch 'timezone-converter' of git://github.com/GlitchMr/zerocl…
requested feature of "noon"/"midnight" when using 12-hour clock in duckduckgo/zeroclickinfo-goodies#125.
Hi again GlitchMr! We're ready to deploy this plugin. Is there a website, twitter account or anything else you would like us to link to with your attribution? This will appear on duckduckgo.com/goodies.html under Conversions.
Well, I don't have Twitter, but I have website - it would be http://glitchmr.github.com/.
This has been deployed to duckduckgo.com :-)
Thanks for deploying, but I'm not mr__shu. Would it be possible to change that to GlitchMr?
Yikes! I'm so sorry. Of course! The change is being deployed right now.
Done! Everything should be correct. Again - I'm sorry about that. I saw your post about writing the plugin! Very cool.