Adding clock in GUI?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
can someone help me in adding the current date and time in the static text box in my GUI?
Thanks alot
Antworten (1)
TastyPastry
am 16 Nov. 2015
You can do something like this:
t = datestr(datetime('now','TimeZone','local','Format','d-MMM-y HH:mm:ss Z'));
This will give you
t = 16-Nov-2015 14:46:33
where t is a string. You can modify the format in the first line. Then, just add this string to your uicontrol().
3 Kommentare
Joseph Cheng
am 16 Nov. 2015
make sure you do not have another function called datetime. datetime is a built in matlab function. if you are unsure if you have another function called date time try first
datetime('now') %should give current date and time.
if that fails then try
which datetime
and see if there is more than one entry and that the only return is located in matlab installation folder.
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!