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






Afrikaans
Alemannisch
Anarâškielâ
العربية
Arpetan

Авар
Azərbaycanca
تۆرکجه

Беларуская

Boarisch
Bosanski
Brezhoneg
Català
Чӑвашла
Čeština
Dansk
Deutsch
ދިވެހިބަސް
Dolnoserbski
Español
Esperanto
Euskara
فارسی
Føroyskt
Français

Hornjoserbsce
Hrvatski
Ilokano
Bahasa Indonesia
Italiano

Ligure
Magyar
Македонски
Malagasy

مصرى
Bahasa Melayu
Мокшень

Napulitano
Нохчийн
Norsk bokmål

Tok Pisin
Plattdüütsch
Português
Qırımtatarca
Română
Русиньскый
Русский
Scots
Seeltersk
Shqip
Simple English
Slovenčina
Slovenščina
Словѣньскъ / 
کوردی
Српски / srpski
Srpskohrvatski / српскохрватски
Sunda
Svenska
Tagalog
Taqbaylit


Türkçe
Українська
اردو
Tiếng Vit


 

Edit links
 









Template
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



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




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
Wikivoyage
 
















Appearance
   

 





Permanently protected template

From Wikipedia, the free encyclopedia
 


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

Syntax

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

Note

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

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

See also

Multiple units of time

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

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:

Month:
{{Lmonth}} produces May
{{Nmonth}} produces Jul
{{LastMonth}} produces May 2024
{{NextMonth}} produces July 2024


Individual templates

Categories of templates


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

Category: 
Date-computing templates
Hidden category: 
Wikipedia template-protected templates
 



This page was last edited on 2 January 2022, at 09:18 (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