EPOCH2STR Returns computes the time sting of the epoch time stored in 'utc_epoch_milli' and 'created'. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: EPOCH2STR Returns computes the time sting of the epoch time stored in 'utc_epoch_milli' and 'created'. CALL: string = epoch2str(tt); string = epoch2str(tt); string = epoch2str(tt) VERSION: $Id: epoch2str.m,v 1.2 2008/07/11 15:16:45 ingo Exp $ HISTORY: 04-04-2008 Diepholz Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function time_str = epoch2str(tt) 0002 % EPOCH2STR Returns computes the time sting of the epoch time stored in 'utc_epoch_milli' and 'created'. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: EPOCH2STR Returns computes the time sting of the epoch time 0007 % stored in 'utc_epoch_milli' and 'created'. 0008 % 0009 % CALL: string = epoch2str(tt); 0010 % string = epoch2str(tt); 0011 % string = epoch2str(tt) 0012 % 0013 % VERSION: $Id: epoch2str.m,v 1.2 2008/07/11 15:16:45 ingo Exp $ 0014 % 0015 % HISTORY: 04-04-2008 Diepholz 0016 % Creation 0017 % 0018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0019 0020 java_tf = tt.timeformat; 0021 for kk = 1:length(java_tf) 0022 switch java_tf(kk) 0023 case 'm' 0024 java_tf(kk) = 'M'; 0025 case 'M' 0026 java_tf(kk) = 'm'; 0027 case 'S' 0028 java_tf(kk) = 's'; 0029 case 'F' 0030 java_tf(kk) = 'S'; 0031 case 'P' 0032 if java_tf(kk+1) == 'M' 0033 java_tf(kk) = 'a'; 0034 java_tf(kk+1) = 'a'; 0035 end 0036 end 0037 end 0038 0039 t_format = java.text.SimpleDateFormat(java_tf); 0040 t_format.setTimeZone(tt.timezone); 0041 time_str = char(t_format.format (tt.utc_epoch_milli)); 0042 0043 java_tf = getappdata(0, 'time_format_str'); 0044 for kk = 1:length(java_tf) 0045 switch java_tf(kk) 0046 case 'm' 0047 java_tf(kk) = 'M'; 0048 case 'M' 0049 java_tf(kk) = 'm'; 0050 case 'S' 0051 java_tf(kk) = 's'; 0052 case 'F' 0053 java_tf(kk) = 'S'; 0054 end 0055 end 0056 t_format = java.text.SimpleDateFormat(java_tf); 0057 t_format.setTimeZone(tt.timezone);