spring kotlin cron code example
Example: 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")
}
}