Skip to content

Timezone converter #125

Merged
merged 5 commits into from Sep 28, 2012

3 participants

@xfix
DuckDuckGo member
xfix commented Sep 28, 2012

I've made small timezone converter according to https://duckduckhack.uservoice.com/forums/5168-plugins/suggestions/3066692-timezone-converter. I hope you like it.

@majuscule majuscule was assigned Sep 28, 2012
@majuscule

Very cool! I've made theses queries countless times myself. I'm taking a look at it right now. Thanks!

@majuscule

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?

@xfix
DuckDuckGo member
xfix commented Sep 28, 2012

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.

@majuscule

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.

@majuscule majuscule merged commit 19be8a2 into duckduckgo:master Sep 28, 2012
@mihugo
mihugo commented Sep 29, 2012

One minor suggestion would be to print out the the full name of the time zone being converted.

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.
.

@xfix
DuckDuckGo member
xfix commented Sep 29, 2012

@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.

@xfix xfix referenced this pull request Sep 29, 2012
Merged

PST is -8, not +8. #126

@mihugo
mihugo commented Sep 30, 2012

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.

Thanks

@xfix
DuckDuckGo member
xfix commented Sep 30, 2012

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.

@majuscule majuscule added a commit that referenced this pull request Sep 30, 2012
@majuscule majuscule Merge branch 'timezone-converter' of git://github.com/GlitchMr/zerocl…
…ickinfo-goodies

requested feature of "noon"/"midnight" when using 12-hour clock in duckduckgo/zeroclickinfo-goodies#125.
b48e603
@majuscule

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.

@xfix
DuckDuckGo member
xfix commented Oct 5, 2012

Well, I don't have Twitter, but I have website - it would be http://glitchmr.github.com/.

@majuscule

This has been deployed to duckduckgo.com :-)

Thanks again!

@xfix
DuckDuckGo member
xfix commented Oct 5, 2012

Thanks for deploying, but I'm not mr__shu. Would it be possible to change that to GlitchMr?

@majuscule

Yikes! I'm so sorry. Of course! The change is being deployed right now.

@majuscule

Done! Everything should be correct. Again - I'm sorry about that. I saw your post about writing the plugin! Very cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.