How do you write a program that gives the current time and day?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alexis Williams
el 8 de Feb. de 2021
Respondida: KSSV
el 8 de Feb. de 2021
I am very new to programming, and cannot figure out how to run this program correctly. My work is shown below. Please Help!
time = clock ();
day = date ();
fprintf('The current date is %f\n', day);
fprintf('The current time is %0f\n', time);
0 comentarios
Respuesta aceptada
KSSV
el 8 de Feb. de 2021
d = datetime('now') ;
fprintf('The current date is %s\n', d);
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Dates and Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!