Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Java String to sql Timestamp

import java.sql.Timestamp;

public class StringToTimeStamp {
    public static void main(String[] args) {

        String dateTime = "2020-12-12 01:24:23";

        Timestamp timestamp = Timestamp.valueOf(dateTime);
        System.out.println(timestamp);
    }
}
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #Java #String #sql #Timestamp
ADD COMMENT
Topic
Name
6+3 =