Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Syntax  





2 Note  





3 Limitations  





4 Examples  





5 See also  





6 Multiple units of time  





7 Single units of time  





8 Date and time templates made for substitution:  



8.1  Individual templates  





8.2  Categories of templates  
















Template:JULIANDAY/sandbox







Add links
 









Template
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 

< Template:JULIANDAY


The result is valid for all proleptic Gregorian calendar dates starting on March 1, 4800 BC (−4799) at midnight.

Syntax

[edit]
{{JULIANDAY|year|[month]|[day]|[hour]|[minute]|[second]}}

Note

[edit]
The julian day, when computed modulo 7, grows from 0 (on Monday at noon) to 6 (on Sunday at noon)) and falls back to 0 (on next Monday). This corresponds to the order of days in the ISO week.

Limitations

[edit]

Before March 4800 BC, the results may be offseted (by up to 365 or 366 days) due to the limitation of the MediaWiki #expr operators used in the implementation.

This limitation could be fixed (and the implementation simplified a bit) by using a - floor(a / b ) * b (now supported in expressions) or the more recent a fmod b, instead of a mod b already too limited in value range (and actually not used in this template), and instead of a - (a / b + 0.5 round 0) + b, as both are truncating their result towards zero, the equivalent of a ceil() when their parameter is negative.

This template was written and optimized to avoid all conditional expressions and to reduce the template expansions to their strict minimum (avoiding also the inclusion of complex templates for computing cyclic modulos, or euclidian divisions and roundings towards minus infinity), because #expr still does not support temporary local variables to store the template parameters and reuse their current value without more expansions.

All problematic negative values are normally avoided by avoiding excessively negative parameter values (using negative values is safe for the day, hour, minute and second parameters, but not safe for the month and year parameters if their resulting month falls before March 4800 BC).

Examples

[edit]

See also

[edit]

Multiple units of time

[edit]
Type Adjustable Current Last Next
Date and time {{time}} {{Currentdate}} (MDY)
{{Plain now}} (DMY)
{{Now}} (DMY in a complete sentence)
{{Simple now}}
Date only {{Dateonly}}
{{Datedow}}
(Has the day of the week)
{{Date}} (Chose format)
{{DATE}} (prefixed by date=)
{{TODAY}} (DMY)
{{Yesterday}}
{{Day-1}}
{{Tomorrow}}
{{Day+1}}
Month and year only {{Monthyear}} {{Monthyear-1}} {{Monthyear+1}}
Time only {{Timeonly}} {{CURRENTTIME}} (12 h format)
{{CURRENTTIME24}} (24 h format)
Banners {{Right now}}
(Blue with time and number of Wikipedia articles)
Timestamp {{Timestamp}}
(Format YYYYMMDDhhmmss)

Single units of time

[edit]
Unit of time Adjustable Current Last Next
SECOND {{CURRENTSECOND}}
MINUTE {{CURRENTMINUTE}}
HOUR {{CURRENTHOUR}}
WEEK {{CURRENTWEEK}}
{{CURRENTWEEKOFMONTH}}
Day of Week {{DAYOFWEEK}} {{CURRENTDAYNAME}}
{{CURRENTWEEKDAYABBREV}}
{{CURRENTWEEKDAY}}
MONTH {{MONTHNAME}}
{{MONTHABBREV}}
{{MONTHNUMBER}}
{{MONTH}} (zero padded)
{{CURRENTMONTHNAME}}
{{CURRENTMONTHABBREV}}
{{CURRENTMONTH1}}
{{CURRENTMONTHDAYS}}
{{LASTMONTHNAME}} {{NEXTMONTHNAME}}
Day of Month {{CURRENTDAY}}
{{CURRENTDAY2}} (zero padded)
YEAR {{CURRENTYEARCC}}
{{CURRENTYEARYY}}
{{CURRENTISOYEAR}}
{{CURRENTYEAR}}
{{LASTYEAR}} {{NEXTYEAR}}
Day of Year {{CURRENTDAYOFYEAR}}
DECADE {{DECADE}} {{CURRENTDECADE}}
CENTURY {{CENTURY}} {{CURRENTCENTURY}}
MILLENNIUM {{MILLENNIUM}}

Date and time templates made for substitution:

[edit]

Month:
{{Lmonth}} produces Jun
{{Nmonth}} produces Aug
{{LastMonth}} produces June 2024
{{NextMonth}} produces August 2024


Individual templates

[edit]

Categories of templates

[edit]

Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:JULIANDAY/sandbox&oldid=846212313"

Category: 
Template sandboxes
 



This page was last edited on 17 June 2018, at 04:55 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki