GET get time properties. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: GET get time properties. CALL: value = get(tt, 'property'); EXAMPLES: name = get(tt, 'name'); utc_epoch_milli = get(tt, 'utc_epoch_milli'); timezone = get(tt, 'timezone'); timezone_IDs = get(tt, 'timezone_IDs'); timezone_IDs = get(tt, 'IDs'); timeformat = get(tt, 'timeformat'); time_str = get(tt, 'time_str'); created = get(tt, 'created'); version = get(tt, 'version'); VERSION: $Id: get.m,v 1.8 2007/10/16 17:37:21 ingo Exp $ HISTORY: 23-07-2007 Diepholz Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function val = get(tt, prop_name) 0002 % GET get time properties. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: GET get time properties. 0007 % 0008 % CALL: value = get(tt, 'property'); 0009 % 0010 % EXAMPLES: name = get(tt, 'name'); 0011 % utc_epoch_milli = get(tt, 'utc_epoch_milli'); 0012 % timezone = get(tt, 'timezone'); 0013 % timezone_IDs = get(tt, 'timezone_IDs'); 0014 % timezone_IDs = get(tt, 'IDs'); 0015 % timeformat = get(tt, 'timeformat'); 0016 % time_str = get(tt, 'time_str'); 0017 % created = get(tt, 'created'); 0018 % version = get(tt, 'version'); 0019 % 0020 % VERSION: $Id: get.m,v 1.8 2007/10/16 17:37:21 ingo Exp $ 0021 % 0022 % HISTORY: 23-07-2007 Diepholz 0023 % Creation 0024 % 0025 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0026 0027 VERSION = '$Id: get.m,v 1.8 2007/10/16 17:37:21 ingo Exp $'; 0028 0029 % Check if this is a call for parameters or for the cvs-version number 0030 if nargin == 2 0031 if isa(tt, 'time') && ischar(prop_name) 0032 in = char(prop_name); 0033 if strcmp(in, 'Params') 0034 val = plist(); 0035 return 0036 elseif strcmp(in, 'Version') 0037 val = VERSION; 0038 return 0039 end 0040 end 0041 end 0042 0043 fields = fieldnames(tt); 0044 0045 fields{end+1} = 'timezone_IDs'; 0046 0047 if strcmpi(prop_name, 'timezone_IDs') || strcmpi(prop_name, 'IDs') 0048 val = java.util.TimeZone.getAvailableIDs; 0049 return 0050 end 0051 0052 if ~ismember(prop_name, fields) 0053 error(['### ''' prop_name, ''' is not a valid time property.']); 0054 else 0055 val = tt.(prop_name); 0056 end 0057 0058