Advertisement
alexandrecoussy

Untitled

Mar 30th, 2022
738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1.   public LocalDateTime objectAsTimestamptoLocalDateTime(Object ob) {
  2.  
  3.     try {
  4.       if (ob instanceof java.sql.Timestamp) { return ((java.sql.Timestamp) ob).toLocalDateTime(); }
  5.       return null;
  6.     } catch (Exception e) {
  7.       return null;
  8.     }
  9.   }
  10.  
  11.   public LocalDate objectAsSqlDatetoLocalDate(Object ob) {
  12.  
  13.     try {
  14.       if (ob instanceof java.sql.Date) { return ((java.sql.Date) ob).toLocalDate(); }
  15.       return null;
  16.     } catch (Exception e) {
  17.       return null;
  18.     }
  19.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement