# util **Repository Path**: jianghui1992/util ## Basic Information - **Project Name**: util - **Description**: 常用的一些工具类 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-01-28 - **Last Updated**: 2021-01-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # util > 常用的一些工具类 ## fastjson处理日期 ```java //第一种 SerializeConfig config = new SerializeConfig(); config.put(Date.class, new SimpleDateFormatSerializer("yyyy-MM-dd")); String str = JSON.toJSONString(u,config); //第二种 JSONObject.DEFFAULT_DATE_FORMAT="yyyy-MM-dd"; String str = JSON.toJSONString(u,SerializerFeature.WriteDateUseDateFormat); //第三种 String str = JSON.toJSONStringWithDateFormat(u, "yyyy-MM-dd", SerializerFeature.WriteDateUseDateFormat); ```