Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Guild of Archivists
Search
Editing
D'ni time conversion
(section)
From Guild of Archivists
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
Edit source
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Algorithm 2. Julian Day Number to Gregorian Date ==== Using real arithmetic, calculate Gregorian Year, Month, Day, Hour, Minute, and Second from a Julian Day (JD) that was calculated according to Algorithm 1. The input JD is assumed to be a real number. Output values are assumed to be integers. A. Extract the number of whole days and calculate the date: <pre> Z = INT(JD) G = Z - 0.25 A = INT(G / 36524.25) B = A - (0.25 * A) Year = INT((G + B) / 365.25) C = Z + B - INT(365.25 * Year) Month = FIX(((5 * C) + 456) / 153) Day = C - FIX(((153 * Month) - 457) / 5)</pre> B. If the month is 13 or 14, adjust the month and year to a January-1 starting point: <pre> if Month > 12 then Year = Year + 1 Month = Month - 12 end if</pre> C. The year is in CE form, meaning that years prior to 1 CE will be 0 or negative. To change such years to BCE form, use the calculation shown below. If this conversion is used, the program should include a variable indicating whether the date is CE or BCE. <pre> if Year < 1 then Year = 1 - Year</pre> D. If JD includes a fractional (time of day) part, extract the fraction and calculate the time: <pre> Z = (JD - INT(JD)) * 86400 Hour = FIX(Z / 3600) R = Z - (Hour * 3600) Minute = FIX(R / 60) Second = R - (Minute * 60)</pre>
Summary:
Please note that all contributions to Guild of Archivists may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
GoArch:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main Page
Random page
Categories
All pages
Recent changes
Resources
D'ni dictionary
Reference material
Utilities
Community
Forums
Jalak Game Directory
Projects
Apocrypha
Unexplored Branches
All projects
Contribute
Stubs
Wanted
Cleanup
Dead ends
Image requested
Help
Help
Guide
Policies
Wiki tools
Wiki tools
Special pages
Page values
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs