Find Jobs
Hire Freelancers

Bug in Julian to Gregorian Date Conversion

max $5 USD

Completed
Posted almost 21 years ago

max $5 USD

Paid on delivery
There is a bug in this Julian to Gregorian Date conversion routine. It converts today 2003:90 to March 31, 2003 to April 00, 2003. Routine follows. Also show that your new routine correctly converts all days of the year. public int[] julianToGregorianDate(int Year, int Day) { double xjdate; double xjd; double z; double fday; double alpha; double a, b; int ic, id, ie; int day, month, iyear; xjd=(4715+Year)*365.25+Day-1110; z = (int)(double)(xjd + 0.5); fday = xjd + 0.5 - z; if (fday < 0.0) { fday = fday + 1.0; z = z - 1; } if (z < 2299161) a = z; else { alpha = ((double)(z - 1867216.25) / 36524.25); a = z + 1.0 + alpha - (int)(double)(alpha / 4.0); } b = a + 1524.0; ic = (int)(double)((b - 122.1) / 365.25); id = (int)(double)(365.25 * ic); ie = (int)(double)((b - id) / 30.6001); day = (int)(double)(b - id - (int)(double) 30.6001 * ie)); if (ie < 14) month = ie - 1; else month = ie - 13; if (month > 2) iyear = ic - 4716; else iyear = Year; int[] dateP; dateP = new int[3]; dateP[0] =iyear; dateP[1] =month; dateP[2] = day; return dateP; ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Complete ownership and distribution copyrights to all work purchased. ## Platform Windows, Linux
Project ID: 2921076

About the project

2 proposals
Remote project
Active 21 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$1 USD in 14 days
5.0 (6 reviews)
3.5
3.5
2 freelancers are bidding on average $3 USD for this job
User Avatar
See private message.
$4.25 USD in 14 days
4.6 (7 reviews)
0.8
0.8

About the client

Flag of UNITED STATES
Carmel Valley, United States
5.0
302
Payment method verified
Member since Jul 1, 2002

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.