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
m
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#vardefine: date|{{{1|{{#time:Y-m-d|{{CURRENTTIMESTAMP}} }} }}} }}
+
<includeonly>{{#vardefine: date|{{#time:Y-m-d|{{{1}}} }} }}{{#ifexpr: ({{{30w|0}}} = 1) and ({{#time:Ymd|{{#var:date}}}} >= 20080527)
{{#if: {{{30w}}}
+
| {{Coordinates/30Wadjusted|{{#var:date}}}}
| {{#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}}
+
| {{Coordinates/Regular|{{#var:date}}}}
| {{#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}}
+
}}</includeonly><noinclude>
}}
+
== Usage ==
 +
<code><nowiki>{{coordinates}}</nowiki></code> gives coordinate fractions out to seven decimal places.  Must be passed a date in '''YYYY-MM-DD''' format.
 +
* <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=1}}</nowiki></code> gives [[30W]]-adjusted coordinates for the same day.
 +
** 30W adjustment has no effect prior to the enactment of the rule on 27 May 2008.
 +
 
 +
[[Category:Coordinate calculation templates|{{PAGENAME}}]]
 +
</noinclude>

Latest revision as of 02:20, 3 July 2008

Usage

{{coordinates}} gives coordinate fractions out to seven decimal places. Must be passed a date in YYYY-MM-DD format.

  • {{coordinates|2008-06-24}} gives non-adjusted coordinates for Tuesday 24 June 2008.
  • {{coordinates|2008-06-24|30w=1}} gives 30W-adjusted coordinates for the same day.
    • 30W adjustment has no effect prior to the enactment of the rule on 27 May 2008.