iOS捷径

使用捷径发一条微博
捷径安装地址

https://jiejinghe.com/shortcuts/1401299993
https://www.icloud.com/shortcuts/da8c3cb760b1435a87c524ee56025446

时间转换


import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class D { public static void main(String[] args) { // System.out.println(parseTime("Thu May 18 2017 10:00:00 GMT+0800")); System.out.println(parseTime("Wed May 22 2019 04:16:41 GMT+0800")); // Wed, 22 May 2019 04:16:41 } /** * 时间转换 * @param datdString * @return */ public static String parseTime(String datdString) { datdString = datdString.replace("GMT", "").replaceAll("\\(.*\\)", ""); //将字符串转化为时间戳 SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss z", Locale.ENGLISH); Date dateTrans = null; try { dateTrans = format.parse(datdString); return dateTrans.getTime()+""; } catch (ParseException e) { e.printStackTrace(); } return datdString; } }