
com.usefulmilk.support.DateTime Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2016 UsefulMilk
*
* Licensed 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 com.usefulmilk.support;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
/**
* This is a support class that defines defaults formats for DateTime.
*/
public final class DateTime {
private static final String ISO_8601_FORMAT_STRING = "yyyy-MM-dd'T'HH:mm:ssZ";
private DateTime(){}
/**
* This method will return a implementation of {@link DateFormat} based on ISO8601.
* According with this ISO8601 the DateTime format have to follow
* this pattern: yyyy-MM-dd'T'HH:mm:ssZ
.
* @return Return a default {@link DateFormat} based on ISO8601.
*/
public static DateFormat ISO8601Format(){
return new SimpleDateFormat(ISO_8601_FORMAT_STRING);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy