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>

  • 相关阅读:
    优先队列(堆)
    从CPU管理到进程的引入
    倾听程序员
    数据库设计
    数据库设计之数据库,数据表和字段等的命名总结
    Set容器--HashSet集合
    Java Collection开发技巧
    关于事务
    关于触发器
    windows phone(成语典籍游戏开发)
  • 原文地址:https://www.cnblogs.com/liubo6/p/4491113.html
Copyright © 2011-2022 走看看