Creates a time widget that consists of separate numeric inputs for the hours, minutes, and seconds. The input and output values of the time widget are instances of DateTimeClasses, these can be converted to and from character strings with strptime and strftime. For a simple example app see shinyTimeExample.

timeInput(inputId, label, value = NULL, seconds = TRUE,
  minute.steps = NULL)



The input slot that will be used to access the value.


Display label for the control, or NULL for no label.


The desired time value. Must be a instance of DateTimeClasses.


Show input for seconds. Defaults to TRUE.


Round time to multiples of minute.steps (should be a whole number). If not NULL sets seconds to FALSE.

See also


## Only run examples in interactive R sessions if (interactive()) { ui <- fluidPage( # Default value is 00:00:00 timeInput("time1", "Time:"), # Set to current time timeInput("time2", "Time:", value = Sys.time()), # Set to custom time timeInput("time3", "Time:", value = strptime("12:34:56", "%T")), # Use %H:%M format timeInput("time4", "Time:", seconds = FALSE), # Use multiples of 5 minutes timeInput("time5", "Time:", minute.steps = 5) ) shinyApp(ui, server = function(input, output) { }) }