Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Jenya Mia
Added: Mar 19, 2019 12:44 PM
Views: 15
Tags: localdate
  1. if(StringDate.matches("\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}"))
  2. {
  3.         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
  4.         LocalDateTime orderDate = LocalDateTime.parse(StringDate, df);
  5.         Timestamp orderDateTs = Timestamp.valueOf(orderDate);
  6. }