Name — Date/Time widget for lcdui forms

Synopsis [ -date date/time in seconds ] [ -label label ] [ -type date | date_time | time ]

$datecmd [cget -optname ] [configure -optname optval ]


Date fields also utilize the common "item" options, described here: lcdui item options


The command creates a widget that can either display, or allow the user to enter a date, a time, or both. For an in-depth look at the Java code that this command is based on, see: javax.microedition.lcdui.DateField

The command takes these options:

  • -label: A label for the date widget.

  • -type: One of date, which only displays a date selection widget, time, which only displays a time selection widget, or date_time, which allows the user to select both a date and a time.

  • -date: The current time, expressed in milliseconds.


set date [ -label "Current date and time:" \
    -date [clock time] -type date_time]
set form [lcdui.form -title "Date Form"]
$form append $date
$form setcurrent

Live example: