Answers for "spring kotlin cron"

0

spring kotlin cron

@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")
    }
}
Posted by: Guest on March-15-2021

Browse Popular Code Answers by Language