时间戳/格林威治时间/当前时间毫秒数:
long nonce=System.currentTimeMillis();
String nonce=System.currentTimeMillis()+"";这句是因为发送请求时时间要用String类型,所以+"",或用String定义.
正常的时间格式:
SimpleDateFormat df1 = new SimpleDateFormat("yyyyMMddHHmmss");
String timestamp = df1.format(new Date());
或
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String timesTamp = df.format(new Date());
String timesTamp = df.format(new Date());