zoukankan      html  css  js  c++  java
  • apache.commons.lang3_DateFormatUtils,RandomStringUtils

    <pre name="code" class="java">System.out.println(DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
    //output 2015-05-04 18:50:54
    System.out.println(DateFormatUtils.format(new Date(), "yyyy-MM-dd hh:mm:ss"));
    //output 2015-05-04 06:50:22
    		
    System.out.println(DateUtils.addDays(new Date(), 1));//增加天数,时间。。等
    System.out.println(DateUtils.isSameDay(new Date(), new Date()));//是否相同日期
    System.out.println(DateUtils.parseDate("2015-05-04", "yyyy-MM-dd"));//str to Date
    System.out.println(RandomStringUtils.randomNumeric(6));//生成随机六位数字   数字参数可以更改
    System.out.println(RandomStringUtils.randomAlphabetic(6));//生成随机六位字母
    System.out.println(RandomStringUtils.randomAlphanumeric(6));//生成随机六位字母数字组合
    System.out.println(RandomStringUtils.random(6, true, true));//六位 第一个boolean 是否包含字母,第二个是否包含数字
    System.out.println(RandomStringUtils.random(6, "abcdefghigkqqqiiiiqq"));//生成六位随机,按给出的字母中取得

    </pre>

  • 相关阅读:
    微信小程序传值
    tp查询中2个表格中字段,比较大小
    isNaN与parseInt/parseFloat
    编程技巧之表格驱动编程
    RGB
    矩形重叠检测。
    经验搜索排名---google已经做过类似的了(我想多了)
    有关编程语言的认识
    Nodepad++ 资料整理
    lower()
  • 原文地址:https://www.cnblogs.com/liubo6/p/4491113.html
Copyright © 2011-2022 走看看