How to convert a string Date to long millseconds

前端 未结 9 2143
你的背包
你的背包 2020-11-29 07:40

I have a date inside a string, something like \"12-December-2012\". How can I convert this into milliseconds (long)?

9条回答
  •  眼角桃花
    2020-11-29 08:18

    Take a look to SimpleDateFormat class that can parse a String and return a Date and the getTime method of Date class.

提交回复
热议问题