Jump to content

User:AvidConanContributor/sandbox: Difference between revisions

From Detective Conan Wiki
mNo edit summary
No edit summary
Line 1: Line 1:
<includeonly>
<includeonly>
{{#expr:  
{{#ifexpr: {{#time:U|{{{2}}} }} - {{#time:U|{{{1}}} }} < 0
<!-- Basic year subtraction -->
  | '''Error:''' DateTime2 is earlier than DateTime1
  {{#time: Y|{{{2}}} }} - {{#time: Y|{{{1}}} }} -
  | {{#expr:  
  <!-- Comparing the months -->
    <!-- Basic year subtraction -->
  {{#ifexpr: {{#time: n|{{{2}}} }} = {{#time: n|{{{1}}} }}
      {{#time: Y|{{{2}}} }} - {{#time: Y|{{{1}}} }} -
    | <!-- Comparing the days -->  
      <!-- Comparing the months -->
      {{#ifexpr: {{#time: j|{{{2}}} }} >= {{#time: j|{{{1}}} }}
      {{#ifexpr: {{#time: n|{{{2}}} }} = {{#time: n|{{{1}}} }}
        | 0
        | <!-- Comparing the days -->  
        | 1
          {{#ifexpr: {{#time: j|{{{2}}} }} >= {{#time: j|{{{1}}} }}
      }} <!-- End of day comparison -->
            | 0
    | {{#ifexpr: {{#time: n|{{{2}}} }} > {{#time: n|{{{1}}} }}
            | 1
        | 0
          }} <!-- End of day comparison -->
        | 1
        | {{#ifexpr: {{#time: n|{{{2}}} }} > {{#time: n|{{{1}}} }}
            | 0
            | 1
          }}
       }}
       }}
  }}
    }}</includeonly><noinclude> <!-- {| class="infobox" style="width: 285px; text-align: left; font-size: 90%;" cellpadding="2"
}}</includeonly><noinclude> <!-- {| class="infobox" style="width: 285px; text-align: left; font-size: 90%;" cellpadding="2"
|-
|-
| colspan="2" style="color: #ffffff; text-align:center; vertical-align:middle; height:28px; font-size: medium; background-color: #2e51a2;" |  '''{{{name}}}'''  
| colspan="2" style="color: #ffffff; text-align:center; vertical-align:middle; height:28px; font-size: medium; background-color: #2e51a2;" |  '''{{{name}}}'''  

Revision as of 17:56, 19 April 2025

YearsBetween

{{#ifexpr: 1745020800 - 1113868800 < 0

 | Error: DateTime2 is earlier than DateTime1
 | 20