1、打开matlab,输入datetime('now');便会显示当前时间
3、输入month(datetime('now'));显示当前月份
5、通过datestr(now,'yyyy/mm/dd HH/MM/SS')可以转化为字符串