Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is easier that in looks. If you have the time passed since UTC midnight, in seconds, like here</p> <pre><code>$gmtSecondsSinceMidnight = (gmmktime() - gmmktime(0,0,0)); </code></pre> <p>then timezones should be within <code>60*60*7</code> and <code>60*60*19</code> seconds distance from that, relative to GMT. 19 is 7pm in 24h notation.</p> <pre><code>$remoteTZStartZ1 = 7*$hour - $gmtSecondsSinceMidnight; $remoteTZEndZ1 = 19*$hour - $gmtSecondsSinceMidnight; </code></pre> <p>This would suffice to formulate a query like </p> <pre><code>echo "SELECT name FROM timezones WHERE (offsetSeconds &gt; $remoteTZStartZ1 AND offsetSeconds &lt; $remoteTZEndZ1);"; </code></pre> <p>However, you'll need to construct two additional brackets if the <code>remoteTZ</code> variables go beyond a 12h offset. Otherwise you might try to select timezones with an offset greater than 12h or below -12h. To make it "wrap around", copy the offsets to ±24h: </p> <pre><code>$remoteTZStartZ2 = $remoteTZStartZ1 - 24*$hour; $remoteTZEndZ2 = $remoteTZEndZ1 - 24*$hour; $remoteTZStartZ3 = $remoteTZStartZ1 + 24*$hour; $remoteTZEndZ3 = $remoteTZEndZ1 + 24*$hour; </code></pre> <p>and use a query like this </p> <pre><code>echo "SELECT name FROM timezones WHERE (offsetSeconds &gt; $remoteTZStartZ1 AND offsetSeconds &lt; $remoteTZEndZ1) OR (offsetSeconds &gt; $remoteTZStartZ2 AND offsetSeconds &lt; $remoteTZEndZ2) OR (offsetSeconds &gt; $remoteTZStartZ3 AND offsetSeconds &lt; $remoteTZEndZ3);"; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload