Some countries used this calendar to the 20th century . The Julian calendar remained in use into the 20th century in some countries as a civil calendar , but has been replaced by the Gregorian calendar in nearly all countries .