DateUtils.java

/*
 * Copyright 2026 Global Crop Diversity Trust
 * Licensed under the Apache License, Version 2.0
 * See LICENSE file in project root folder or http://www.apache.org/licenses/LICENSE-2.0
 */

package org.gringlobal.util;

import java.text.SimpleDateFormat;

public abstract class DateUtils {

	/**
	 * Make date format.
	 *
	 * @param dateFormat the date format
	 * @return the thread local
	 */
	public static ThreadLocal<SimpleDateFormat> makeDateFormat(final String dateFormat) {
		return new ThreadLocal<SimpleDateFormat>() {
			@Override
			protected SimpleDateFormat initialValue() {
				// 2009-01-09T00:00:00-08:00
				final SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
				return sdf;
			}
		};
	}
}