0001 function str=date2tstr(time)
0002
0003
0004
0005
0006
0007
0008
0009
0010 c{1}=num2str(time.day);
0011 if time.day<10
0012 c{1}=['0',c{1}];
0013 end
0014 c{2}='-';
0015 c{3}=time.month;
0016 c{4}='-';
0017 c{5}=num2str(time.year);
0018 c{6}=':';
0019 c{7}=num2str(time.hour);
0020 if time.hour<10
0021 c{7}=['0',c{7}];
0022 end
0023 c{8}=':';
0024 c{9}=num2str(time.min);
0025 if time.min<10
0026 c{9}=['0',c{9}];
0027 end
0028 c{10}=':';
0029 c{11}=num2str(time.sec);
0030 if time.sec<10
0031 c{11}=['0',c{11}];
0032 end
0033
0034 str=[];
0035 for i=1:length(c)
0036 str=[str c{i}];
0037 end
0038