how to convert datetime to timestamp in java

前端 未结 5 1979
萌比男神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 21:57

    Of course only the date is parsed, since the pattern you provided to the SimpleDateFormat constructor only contains the date part! Add the time part to it and it will parse the time too just fine.

提交回复
热议问题