📜  spring kotlin cron - Kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:34.944000             🧑  作者: Mango

代码示例1
@Component
class Task {
@Scheduled(cron = "0 0 0 16 3 ?") //  ss mm hh D M freq
  fun timing() {
        log.info("The time is now {}", dateFormat.format(Date()))
    }

    companion object {
        private val log = LoggerFactory.getLogger(Tarea::class.java)
        private val dateFormat = SimpleDateFormat("HH:mm:ss")
    }
}