Generation

generate functionFri, 31 Mar 2023

genera una conversion java timestamp google cloud a timestamp sql java

static String convertirTimestamp(String timestamp) { String strDate = ""; timestamp = timestamp.replace("-", "").replace("Z", "").replace(":", ""); DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); Date date = null; try { date = formatter.parse(timestamp); } catch (ParseException e) { e.printStackTrace(); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); strDate = sdf.format(date); return strDate; }

Questions about programming?Chat with your personal AI assistant