24H time from datetime('now')

조회 수: 21 (최근 30일)
Samee Imtiyaz
Samee Imtiyaz 2021년 7월 12일
답변: KSSV 2021년 7월 12일
I am using datetime('now') to get the current time in my matlab analysis app code. However, it returns the datetime variable in 12 hour time without an AM/PM. In my code I am using isbetween to check whether the current time is within a range althought this range is in 24H time.
Is there any way to change the datetime('now') in the matlab analysis app on thingSpeak to 24H time as it gives me 24H time format when I try on the normal matlab console.
  댓글 수: 1
KSSV
KSSV 2021년 7월 12일
You can provide the input format you want. Read about the function.

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2021년 7월 12일
t = datetime('now') ;
t.Format = 'dd-MMM-uuuu HH:mm a'
t = datetime
12-Jul-2021 10:05 AM

추가 답변 (0개)

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by