Date and Time
Last updated
// Display current time
log "Current time: " ++ hour ++ ":" ++ minute ++ ":" ++ second
// Display current date
log "Today is " + day + ", " + month + " " + day_number + ", " + year
// Format date with conditional suffix
suffix = "th"
if day_number % 10 == 1 and day_number != 11 (
suffix = "st"
)
if day_number % 10 == 2 and day_number != 12 (
suffix = "nd"
)
if day_number % 10 == 3 and day_number != 13 (
suffix = "rd"
)
log "Today is the " + day_number + suffix + " of " + month
// Use the arrays to find the day of week by index
tomorrow_index = (days.index(day) + 1) % 7
log "Tomorrow is " ++ days[tomorrow_index]