0001 function t = fromxml(xml)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 sch = xml.getChildNodes;
0015 for c=1:sch.getLength
0016 x = sch.item(c-1);
0017 switch char(x.getNodeName)
0018 case 'utc_epoch_milli'
0019 utc_epoch_milli = str2num(char(x.getTextContent));
0020 case 'timezone'
0021 timezone = char(x.getTextContent);
0022 case 'timeformat'
0023 xch = x.getChildNodes;
0024 tf = timeformat(xch.item(1));
0025 case 'time_str'
0026 time_str = char(x.getTextContent);
0027 otherwise
0028 end
0029 end
0030
0031
0032 t = time(utc_epoch_milli);
0033 t = set(t, 'timezone', timezone);
0034
0035
0036