- public static long GenerateTimestamp(String s){
- try{
- //07/06/01 12:00 AM
- SimpleDateFormat format = new SimpleDateFormat("MM/dd/yy hh:mm a");
- Date d = format.parse(s);
- return (d.getTime()/1000);
- }
- catch(Exception ex){
- return 0;
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/310120132015.html
来源: http://www.codesnippet.cn/detail/310120132015.html