24H time from datetime('now')

19 visualizaciones (últimos 30 días)
Samee Imtiyaz
Samee Imtiyaz el 12 de Jul. de 2021
Respondida: KSSV el 12 de Jul. de 2021
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 comentario
KSSV
KSSV el 12 de Jul. de 2021
You can provide the input format you want. Read about the function.

Iniciar sesión para comentar.

Respuesta aceptada

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

Más respuestas (0)

Comunidades de usuarios

Más respuestas en  ThingSpeak Community

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by