how to convert datetime to timestamp in java

前端 未结 5 2057
萌比男神i
萌比男神i 2021-01-22 21:24

forum member

I am having one problem with date time in java. Actually I am receiving the startdate in format 2012-02-27T01:10:10 and I want to insert th

5条回答
  •  忘掉有多难
    2021-01-22 22:12

    SimpleDateFormat's format() method doesn't return a Date type.

    try this:

    Date startDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").parse(sDate);
    

提交回复
热议问题