Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Metodo Para Passar Parametro Para o Banco
- public static String formatDateJdbc(String data){
- SimpleDateFormat f = new SimpleDateFormat("dd/MM/yyyy");
- Date d1 = null;
- try {
- d1 = f.parse(data);
- } catch (Exception e) {
- e.printStackTrace();
- }
- SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
- data = format.format(d1);
- return data;
- }
- // Método Para Mostrar Paara o Usuario
- public static String formatDateUser(String data){
- SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");
- Date d1 = null;
- try {
- d1 = f.parse(data);
- } catch (Exception e) {
- e.printStackTrace();
- }
- SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
- data = format.format(d1);
- return data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement