Last active
February 3, 2017 04:46
-
-
Save gaverdugo/25ad49f91af29929e122cfc9592afba3 to your computer and use it in GitHub Desktop.
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.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
/** | |
* Created by German on 2/2/2017. | |
*/ | |
class DateFormat { | |
public static String changeDateFormat(String date) { | |
String pattern = "(^[0-3]?[0-9])|((?:[0-9]{2})?[0-9]{2})|([0-1]?[0-9])|"; | |
Pattern p = Pattern.compile(pattern); | |
Matcher m; | |
m = p.matcher(date); | |
while(m.find()){ | |
m.group(); | |
System.out.println(m.group()); | |
} | |
return | |
} | |
} | |
public class Main { | |
public static void main(String[] args) { | |
System.out.println(DateFormat.changeDateFormat("03/02/1996")); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment