Convert string Date into timestamp in Android?

后端 未结 5 736
面向向阳花
面向向阳花 2020-12-01 12:03

I want to convert my date (which is in String format), e.g. 13-09-2011, into Timestamp. I used below code but I got the 2011-09-13 00:00:00.0 as a result. But I want Timest

5条回答
  •  不知归路
    2020-12-01 12:35

    It may can help you

        long time= System.currentTimeMillis();//timestamp in milliseconds of current time
    
    
        String tp = Long.toString(time);//use timestamp as a string
    

提交回复
热议问题