Convert a Regular Date to Julian Date and vice versa in Java
问题 I've written a simple code that converts a regular date to Julian date. Here's the code for those who need the same conversion: public int convertToJulian(String unformattedDate) { /*Unformatted Date: ddmmyyyy*/ int resultJulian = 0; if(unformattedDate.length() > 0) { /*Days of month*/ int[] monthValues = {31,28,31,30,31,30,31,31,30,31,30,31}; String dayS, monthS, yearS; dayS = unformattedDate.substring(0,2); monthS = unformattedDate.substring(3, 5); yearS = unformattedDate.substring(6, 10);