package com.sifang.modules.platform.utils;

import org.springframework.context.annotation.Configuration;

import java.util.Calendar;
import java.util.Date;
import java.util.Timer;

@Configuration
public class TimerTest02 {
    Timer timer;

   /* @Bean
    public TimerTest02 init(){
        Date time = getTime();
        System.out.println("指定时间time=" + time);
        timer = new Timer();
        timer.schedule(new CleanAndChangeTask(), time);
        return this;
    }*/

    public Date getTime(){
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.DAY_OF_MONTH,11);
        calendar.set(Calendar.HOUR_OF_DAY, 12);
        calendar.set(Calendar.MINUTE, 00);
        calendar.set(Calendar.SECOND, 00);
        Date time = calendar.getTime();

        return time;
    }


    public static void main(String[] args) {
        new TimerTest02();
    }
}

/*class TimerTaskTest02 extends TimerTask {

    @Override
    public void run() {
        System.out.println("指定时间执行线程任务...,统计结账记录信息"+new Date());
    }
}*/
