24H time from datetime('now')

18 次查看(过去 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 Community

类别

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