Categories
木有技术 爪机爪机

android获得timestamp时间戳

android里如何获得timestamp时间类型呢 在stackoverflow上的5268495

String myDate = new String("your date");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = format.parse(myDate);
date.getTime(); //fetch the time as milliseconds from Jan 1, 1970
Calendar.getInstance.getTimeInMillis()

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.