Created
April 20, 2021 14:55
-
-
Save trplll/e71711fa0e7c26a3f24ab398ec72bbcc to your computer and use it in GitHub Desktop.
Groovy Jde Julian to Java Date Conversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
class Main { | |
static void main(String... args) { | |
println JulianDateToJavaDate(121110) | |
} | |
public static Date JulianDateToJavaDate(Integer julianDate) { | |
Date date = null; | |
String j = julianDate.toString(); | |
try { | |
date = new SimpleDateFormat("Myydd").parse(j) | |
return date; | |
} catch (ParseException e) { | |
System.out.println(e.getMessage()); | |
return; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment