Here is today's history lesson though it doesn't directly answer your question
The Julian calendar dates back to the time of Julius Caesar and was used across most of Europe for many centuries. Unfortunately it didn't quite allow for the actual time taken for the earth to go round the sun so gradually in became more & more inaccurate.
As a result, the Gregorian calendar was introduced in the time of Pope Gregory III but not in all countries at the same time
Much of Europe changed in 1582 but some countries like the UK didn't like these new fangled 'foreign' ideas and delayed the transition.
The UK was I believe one of the last & didn't change until 1752.
When the UK finally did so 11 days were 'lost' form the calendar leading to the 'Give Us Our Eleven Days' calendar riots of 1752.
See
https://www.historic-uk.com/HistoryU...r-eleven-days/
Which means dates prior to 1582 can be converted fairly easily & those after 1752 may be OK. In between those dates is more of an issue and it seems for example that Access & SPSS use different criteria for determining the correct dates between 1582 and 1752.
As to how you convert 'correctly', you'll either need to write a conversion algorithm or use one done by someone else. It will depend on the country you are referring to. In reality there is no such thing as a 'correct' date.
This link may give what you need
https://stevemorse.org/jcal/julian.html
Note that the UK wasn't last to change - for example Albania changed in 1912 & Turkey in 1927.
Sweden is a very 'interesting' example - this is from Steve Morse website
In an attempt to have a gradual conversion, Sweden decided not to have leap days from 1700 to 1740.
But after skipping leap day in 1700, they abandonded the plan.
This put them out of line with both the Julian and Gregorian calendars.
In 1712 they reverted back to the Julian calendar by having 30 days in Feb that year.
If nothing else, you may be able to use some of this info in pub quiz questions!