package com.utopiaindustries.qualitychecker.utils;

import android.os.Build;

import androidx.annotation.RequiresApi;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class DateTimeUtils {

	public static final String HTML5_DATETIME_INPUT_FORMAT_WITH_SECONDS = "yyyy-MM-dd'T'HH:mm:ss";

	/**
	 * format localdatetime into a given format string
	 */
	@RequiresApi(api = Build.VERSION_CODES.O)
    public static String getFormattedDateTimeString(LocalDateTime dateTime, String dateTimeFormat ) {
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern( dateTimeFormat );
		return dateTime.format( formatter );
	}
}
