For AI agents: the complete documentation index is available at /docs/2025/llms.txt, the full documentation bundle is available at /docs/2025/llms-full.txt, and this page is available as Markdown at /docs/2025/project/java/util.md.
  • 简体中文
  • 2025
  • 工具类

    Graph

    Bean Copy

    反射

    Format

    • sql。

    • 日期&时间

      • prettytime

      • commons-lang。

        public class Test {
        
            public static void main(String[] args) {
                Duration duration = Duration.ofSeconds(61);
                // 1 minute 1 second
                System.out.println(DurationFormatUtils.formatDurationWords(duration.toMillis(), true, true));
                // 0天0小时1分钟1秒
                System.out.println(DurationFormatUtils.formatDuration(duration.toMillis(), "d'天'H'小时'm'分钟's'秒'"));
                // 00天00小时01分钟01秒
                System.out.println(DurationFormatUtils.formatDuration(duration.toMillis(), "dd天HH小时mm分钟ss秒"));
            }
        }
    • 金钱

    • 数字

      • jdk。NumberFormat、DecimalFormat