package com.its.wthr.openApi.vilageFcstInfoService;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;

/**
 * 초간기실황조회
 */
public class UltraSrtNcstData extends VilageFcstInfo {

    public String getBaseDate() {
        LocalDateTime dateTime = LocalDateTime.now();
        DateTimeFormatter fmtDay = DateTimeFormatter.ofPattern("yyyyMMdd");
        return dateTime.format(fmtDay);
    }

    public String getBaseTime() {
        Calendar cal = Calendar.getInstance();
        cal.setTime(cal.getTime());
        cal.add(Calendar.HOUR_OF_DAY, -1);	/* 주어진 시각에서 1초를 뺀 시각 */
        return new SimpleDateFormat("HH").format(cal.getTime()) + "00";
    }

}
