- 博客(6)
- 收藏
- 关注
原创 字符串转时间戳
/** * 获取UTC时间戳 * 字符串日期转换成Date,在转成Calendar,获取UTC时间戳 * @return * @throws ParseException */ public long Timestamp(int type,String datetime){ Calendar cal = Calendar.getInstance(); long Time_stamp = 0; SimpleDateFormat sdf = new SimpleDateFor
2021-08-13 11:47:43 194
原创 计算两个日期相差天数
/** * 计算两个日期之间相差的天数 * @param sdate 较小的时间 * @param edate 较大的时间 * @return 相差天数 * @throws ParseException */ public static int daysBetween(String sdate, String edate) throws ParseException { SimpleDateFormat sdf = new.
2021-08-13 11:42:57 109
原创 数字金额大写转换
/** * 数字金额大写转换,先写个完整的然后将如零拾替换成零 要用到正则表达式 */ public static String digitUppercase(double n) { String fraction[] = { "角", "分" }; String digit[] = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; String unit[][] = { {
2021-08-13 11:41:25 92
原创 检验邮件地址是否合格
/** * 检验邮件地址是否合格 * @param email * @return */ public boolean getCheckEmail(String email){ String check = "^([a-z0-9A-Z]+[-|_|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"; Pattern regex = Pattern.compile(check); Match
2021-08-13 11:34:05 103
原创 通过Http请求调接口
/** * HTTP * @param url 地址 * @param param json 字符串 * @param Auth 消息头 * @param Method POST * @return */ public static String postheader(String url, String param,String Auth,String Method) { String data = param; try { URL testurl = n.
2021-08-13 11:30:42 117
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人