Template:Stardate: Difference between revisions
Aigle Phos (talk | contribs) (Template should work. In testing) |
m (fixing broken link at first bc that's easy and now i will dissect this to see what is wrong in general with the code) |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{#if: {{{1|}}} | {{#if: {{{2|}}} | {{#if: {{{3|}}} | {{{1|}}}{{{2|}}}.{{{3|}}} | {{#expr:{{#time: Y }}+377}}{{#time: m.d }} }} | {{#expr:{{#time: Y }}+377}}{{#time: m.d }} }} | {{#expr:{{#time: Y }}+377}}{{#time: m.d }} }} | <includeonly>{{#if: {{{1|}}} | {{#if: {{{2|}}} | {{#if: {{{3|}}} | {{#expr:{{{1|}}}+377}}{{{2|}}}.{{{3|}}} | {{#expr:{{#time: Y }}+377}}{{#time: m.d }} }} | {{#expr:{{#time: Y }}+377}}{{#time: m.d }} }} | {{#expr:{{#time: Y }}+377}}{{#time: m.d }} }}</includeonly><noinclude>This template will automatically convert a arbitrary date to the one used inside UFOP, as outlined [[Stardate|here]]. If no date is passed to it, it will default to the current date. | ||
==How to use== | |||
To calculate the current Stardate ''(Note: This will change with time)''<br /> | |||
'''<nowiki>{{stardate}}</nowiki>''' | |||
To calculate a arbitrary Stardate <br /> | |||
'''<nowiki>{{stardate|Year|Month|Day}}</nowiki>''' | |||
'''''NB. Notice that you DO add leading zeros for the month or day if it is a single digit.''''' | |||
==Examples== | |||
[[James]] was assigned to the {{USS|Drake}} on the 7th February, 2013. To convert this to UFOP time you would use:<br /> | |||
'''<nowiki>{{stardate|2013|02|07}}</nowiki>''' <br /> | |||
Which would output: '''{{stardate|2013|02|07}}''' | |||
I want to put a continually updating clock in UFOP time on a page. I would use <br /> | |||
'''<nowiki>{{stardate}}</nowiki>''' <br /> | |||
Which would output: '''{{stardate}}''' | |||
If you have any questions, or spot an error, please contact [[User:JamesTPau| James]] | |||
[[Category:Templates]]</noinclude> |
Latest revision as of 20:51, 11 November 2024
This template will automatically convert a arbitrary date to the one used inside UFOP, as outlined here. If no date is passed to it, it will default to the current date.
How to use
To calculate the current Stardate (Note: This will change with time)
{{stardate}}
To calculate a arbitrary Stardate
{{stardate|Year|Month|Day}}
NB. Notice that you DO add leading zeros for the month or day if it is a single digit.
Examples
James was assigned to the USS Drake on the 7th February, 2013. To convert this to UFOP time you would use:
{{stardate|2013|02|07}}
Which would output: 239002.07
I want to put a continually updating clock in UFOP time on a page. I would use
{{stardate}}
Which would output: 240111.11
If you have any questions, or spot an error, please contact James