package com.zehong.system.modbus.util;

import com.zehong.system.domain.vo.WriteCurrentTimeVo;

import java.util.Calendar;

/**
 * @author lenovo
 * @date 2025/12/26
 * @description 日期对象生成类
 */
public class WriteCurrentTimeUtil {

    public static WriteCurrentTimeVo generateWriteCurrentTimeVo(){

        Calendar cal = Calendar.getInstance();
        int year = cal.get(Calendar.YEAR);
        int month = cal.get(Calendar.MONTH) + 1;
        int day = cal.get(Calendar.DATE);
        int hour = cal.get(Calendar.HOUR_OF_DAY);
        int minute = cal.get(Calendar.MINUTE);

        WriteCurrentTimeVo writeCurrentTimeVo = new WriteCurrentTimeVo();
        writeCurrentTimeVo.setYear(year);
        writeCurrentTimeVo.setMonth(month);
        writeCurrentTimeVo.setDay(day);
        writeCurrentTimeVo.setHour(hour);
        writeCurrentTimeVo.setMinute(minute);
        return writeCurrentTimeVo;
    }
}
