我想获取 GMT 的当前时间戳;任何想法如何做到这一点?
我设法得到一个gmt格式的字符串问题是我想将此字符串转换为等效的时间戳对象,即同一时间但作为时间戳对象
SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss zzz");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
Date date=new Date();
String s=sdf.format(date);
System.out.println("GMT: "+s);
//need to convert the string to equivalent timestamp object