Template:DaysSinceStart: Difference between revisions

From Know Islam
Jump to navigation Jump to search
No edit summary
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#if: {{{1|}}} |  
<noinclude>
== Usage ==
This template calculates the number of days since a given start date.
 
=== Syntax ===
<pre>
{{DaysSinceStart|YYYY-MM-DD}}
</pre>
 
=== Example ===
<pre>
{{DaysSinceStart|2023-08-26}}
</pre>
 
This example will display the number of days since August 26, 2023.
 
== Notes ==
*Ensure the date is provided in the format YYYY-MM-DD.
*If no start date is provided, the template will display an informational message.
</noinclude>
 
<includeonly>{{#if: {{{1|}}} |  
   {{#expr:  
   {{#expr:  
     ({{#time: U}} - {{#time: U | {{{1}}}}}) / 86400 round 0  
     ({{#time: U}} - {{#time: U | {{{1}}}}}) / 86400 round 0  
   }}  
   }}  
|  
|  
  <!-- Custom message for when no start date is provided -->
   This template calculates the number of days since a given start date. Please provide a start date in the format YYYY-MM-DD.
   This template calculates the number of days since a given start date. Please provide a start date in the format YYYY-MM-DD.
}}
}}</includeonly>

Latest revision as of 02:29, 21 July 2024

Usage

This template calculates the number of days since a given start date.

Syntax

{{DaysSinceStart|YYYY-MM-DD}}

Example

{{DaysSinceStart|2023-08-26}}

This example will display the number of days since August 26, 2023.

Notes

  • Ensure the date is provided in the format YYYY-MM-DD.
  • If no start date is provided, the template will display an informational message.