필터 지우기
필터 지우기

How do you write a program that gives the current time and day?

조회 수: 1 (최근 30일)
Alexis Williams
Alexis Williams 2021년 2월 8일
답변: KSSV 2021년 2월 8일
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);

채택된 답변

KSSV
KSSV 2021년 2월 8일
d = datetime('now') ;
fprintf('The current date is %s\n', d);
The current date is 08-Feb-2021 05:19:58

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by