How to convert a string Date to long millseconds

前端 未结 9 2173
你的背包
你的背包 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:21

    Easiest way is used the Date Using Date() and getTime()

        Date dte=new Date();
        long milliSeconds = dte.getTime();
        String strLong = Long.toString(milliSeconds);
        System.out.println(milliSeconds)
    

提交回复
热议问题