Difference between revisions of "Template:Coordinates"
From Geohashing
imported>Tjtrumpet2323 (hopefully, in a few more edits, this will generate coordinates for a given day) |
imported>Tjtrumpet2323 |
||
Line 1: | Line 1: | ||
− | {{#vardefine: date|{{{1|{{#time:Y-m-d|{{CURRENTTIMESTAMP}} }} }}} }} | + | {{#if: {{{1}}} |
+ | | {{#vardefine: date|{{#time:Y-m-d|{{{1}}} }} }} | ||
+ | | {{#ifexpr: {{#time:Hi|{{CURRENTTIMESTAMP}}}} + (100*{{isusdst}}) >= 1430 | ||
+ | | {{#vardefine: date|{{#time:Y-m-d|{{CURRENTTIMESTAMP}} }} }} <!-- past 09:30 ET; Dow would have opened --> | ||
+ | | {{#vardefine: date|{{#time:Y-m-d|{{CURRENTTIMESTAMP}} -1 day }} }} <!-- Dow would not yet be open --> | ||
+ | }} | ||
+ | }} | ||
+ | |||
{{#if: {{{30w}}} | {{#if: {{{30w}}} | ||
| {{#expr:{{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}} -1 day}}|{{#time: m|{{#var:date}} -1 day}}|{{#time: d|{{#var:date}} -1 day}}}} |1|1}} round 7}}, {{#expr:{{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}} -1 day}}|{{#time: m|{{#var:date}} -1 day}}|{{#time: d|{{#var:date}} -1 day}}}} |2|1}} round 7}} | | {{#expr:{{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}} -1 day}}|{{#time: m|{{#var:date}} -1 day}}|{{#time: d|{{#var:date}} -1 day}}}} |1|1}} round 7}}, {{#expr:{{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}} -1 day}}|{{#time: m|{{#var:date}} -1 day}}|{{#time: d|{{#var:date}} -1 day}}}} |2|1}} round 7}} | ||
| {{#expr:{{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}}}}|{{#time: m|{{#var:date}}}}|{{#time: d|{{#var:date}}}}}} |1|1}} round 7}}, {{#expr:{{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}}}}|{{#time: m|{{#var:date}}}}|{{#time: d|{{#var:date}}}}}} |2|1}} round 7}} | | {{#expr:{{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}}}}|{{#time: m|{{#var:date}}}}|{{#time: d|{{#var:date}}}}}} |1|1}} round 7}}, {{#expr:{{#md5:{{#time: Y-m-d|{{#var:date}}}}-{{#dow:{{#time: Y|{{#var:date}}}}|{{#time: m|{{#var:date}}}}|{{#time: d|{{#var:date}}}}}} |2|1}} round 7}} | ||
− | }} | + | }}<noinclude> |
+ | == Usage == | ||
+ | <code><nowiki>{{coordinates}}</nowiki></code> gives coordinate fractions out to seven decimal places. | ||
+ | * Passing no parameters gives coordinates for the current "Dow day" (09:30 [[ET]] to 09:30 ET the following day, regardless of whether the [[Dow]] actually opens). | ||
+ | ** <code><nowiki>{{coordinates|2008-06-24}}</nowiki></code> gives non-adjusted coordinates for {{date link|2008-06-24}}. | ||
+ | ** <code><nowiki>{{coordinates|2008-06-24|30w}}</nowiki></code> gives [[30W]]-adjusted coordinates for the same day. | ||
+ | |||
+ | {{note|Currently applies [[30W]] incorrectly to dates prior to [[2008-05-27]]; fixing soon. --[[User:Tjtrumpet2323|Tim P]] 02:44, 2 July 2008 (UTC)}} | ||
+ | </noinclude> |
Revision as of 02:44, 2 July 2008
0.9976492, 0.8226515
Usage
{{coordinates}}
gives coordinate fractions out to seven decimal places.
- Passing no parameters gives coordinates for the current "Dow day" (09:30 ET to 09:30 ET the following day, regardless of whether the Dow actually opens).
{{coordinates|2008-06-24}}
gives non-adjusted coordinates for Tuesday 24 June 2008.{{coordinates|2008-06-24|30w}}
gives 30W-adjusted coordinates for the same day.
Note: Currently applies 30W incorrectly to dates prior to 2008-05-27; fixing soon. --Tim P 02:44, 2 July 2008 (UTC)