Hi im using world clock and get ehe 00:00 PM and it is a wrong way, it must be 12 PM
how can i solve it??
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | worldclock.module-D6.patch | 794 bytes | jerdiggity |
Hi im using world clock and get ehe 00:00 PM and it is a wrong way, it must be 12 PM
how can i solve it??
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | worldclock.module-D6.patch | 794 bytes | jerdiggity |
Comments
Comment #1
madwalo commentedWhy nobody answer?????
Comment #2
pixture commentedChange the worldclock.js file at line #209 and #214.
--before--
if (wk >= 12) wk -= 12;
--after--
if (wk > 12) wk -= 12;
I guess this will take care of the issue.
Comment #3
madwalo commentedit works perfectly! thanks a lot
but when i set my cumputer's clock to 12:4 PM
The website changes too.
shouldn't it be restricted to the server hour??
Comment #4
pixture commentedI'm glad that fixed the issue.
> but when i set my cumputer's clock to 12:4 PM
> The website changes too.
> shouldn't it be restricted to the server hour??
Actually, the time displayed on the WorldClock block of the Drupal site is based on your PC's time. WorldClock module gives Javascript information on the module's settings (such as time differences of selected time zone, DST settings, etc) and the Javascript which runs at your browser will convert your PC's time to the time of other tone zones and displays them. It's not practical to get time from server every seconds (using Ajax?) for just displaying times. Therefore, if you access your Drupal site from two PCs and they have slight difference in their local time setting, you will see different times.
Anyway, I will add this fix to the next release.
Comment #5
madwalo commentedThe updating of the clock is perfect in javascript, but the start time should be set by the server time GMT, because if user's time is wrong, site's time will be too
thanks!
Comment #6
pixture commentedThat's requires some work because the Javascript needs to figure out the time difference between the server and your local PC in order to set the start time based on the server's time.
I am not sure if this is easy or not. Needs to investigate on it.
Comment #7
akagroundhog commentedThere's no need to get time from server every second. I suppose, the most practical decision is to get time from server once (on page load) and then increase it every second with javascript. For example, we can get time on the server with php and put the time value to the $settings['server_time'] (worldclock.module), and then, when the page will loaded, get the time value from Drupal.settings.server_time and increase this value each second with javascript (worldclock.js). Yet in this case there is an inaccuracy, because php executes before page loading and javascript after, I think it's acceptable decision.
Also, I think it should be an option, something like checkbox in module settings page so the administrators can select whether display time based on client's time (old algorithm), or based on server's time (new algorithm).
Comment #8
madwalo commentedgreat idea
Comment #9
jerdiggity commentedMaintainers (and/or "whoever else"):
As I've encountered the same problem (screenshot can be seen here), attached please find a patch for this issue as addressed above.
Thx in advance. :)
j