Skip to content

Instantly share code, notes, and snippets.

@gaverdugo
Last active February 3, 2017 04:46
Show Gist options
  • Save gaverdugo/25ad49f91af29929e122cfc9592afba3 to your computer and use it in GitHub Desktop.
Save gaverdugo/25ad49f91af29929e122cfc9592afba3 to your computer and use it in GitHub Desktop.
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