How to change datetime format?
60 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sim
el 13 de Jun. de 2023
Comentada: Sim
el 13 de Jun. de 2023
Given this:
datetime('02-Jul-2023','InputFormat','dd-MMM-yyyy')
How can I get this format ?
datetime('02-Jul-2023 22:00:00')
0 comentarios
Respuesta aceptada
Stephen23
el 13 de Jun. de 2023
Editada: Stephen23
el 13 de Jun. de 2023
You can specify different formats for the input and display:
DT = datetime('02-Jul-2023','InputFormat','dd-MMM-yyyy', 'Format','dd-MMM-yyyy HH:mm:ss')
If it is an existing DATETIME object, then simply modify its FORMAT property as you wish, e.g.:
DT.Format = 'uuuuDDD' % ISO 8601 day-number format
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!