|
Java example source code file (DurationFormatUtils.java)
The DurationFormatUtils.java Java example source code/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.lang3.time; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; /** * <p>Duration formatting utilities and constants. The following table describes the tokens * used in the pattern language for formatting. </p> * <table border="1" summary="Pattern Tokens"> * <tr> | y | years | * <tr>M | months | * <tr>d | days | * <tr>H | hours | * <tr>m | minutes | * <tr>s | seconds | * <tr>S | milliseconds | * <tr>'text' | arbitrary text content | * </table> * * <b>Note: It's not currently possible to include a single-quote in a format. * <br> * Token values are printed using decimal digits. * A token character can be repeated to ensure that the field occupies a certain minimum * size. Values will be left-padded with 0 unless padding is disabled in the method invocation. * @since 2.1 */ public class DurationFormatUtils { /** * <p>DurationFormatUtils instances should NOT be constructed in standard programming. * * <p>This constructor is public to permit tools that require a JavaBean instance * to operate.</p> */ public DurationFormatUtils() { super(); } /** * <p>Pattern used with
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.