将字符日期字符串转换为日期向量
8次浏览(过去30天)
显示旧的注释
答案(1)
欧美
2019年2月4日
编辑:欧美
2019年2月4日
myString =2014 - 07 - 03 t04:00:00.000000z;
myDateString =日期时间(myString,“InputFormat”,“yyyy-MM-dd“T”HH: mm: ss。瑞士“Z”,“时区”,UTC的);
dateOnly = myDateString;为日期创建副本
timeOnly = myDateString;%创建副本的次数
dateOnly。格式=“dd-MM-yyyy”;%日期/ x
timeOnly。格式=“HH: mm: ss。瑞士的;%次/ y
或者使用正则表达式
D = regexp(输入,”(<日期>。* ?)T(<时间>。* ?)Z”,“名字”);
% D。日期= '2014-07-03'
% D。时间= '04:00:00.000000';