public class Test01 {
public static void main(String[] args) {
// StringBuilder responseMsg = new StringBuilder();
// responseMsg.append("");
// responseMsg.append("");
// System.out.println(responseMsg.length());
JSONObject jsonObj = new JSONObject();
// Map<String, String> ingredients = new HashMap<String, String>();
Date dNow = new Date( );
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
String dNowStr = dateFormat.format(dNow);
System.out.println("当前时间为: " + dNowStr);
jsonObj.put("trans_date", dNowStr);
jsonObj.put("curacc", "XXXXXXX");
// System.out.println(jsonObj);
String json_to_string = JSONObject.toJSONString(jsonObj);
System.out.println(json_to_string);
}
}
标签:jsonObj,responseMsg,Java,System,println,Json,字符串,new,out From: https://www.cnblogs.com/rainbow-1/p/17703278.html