www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/ConvertDateStringtoDateNumberUsingPivotYearExample.m

    %% Convert Text Representing Date to Date Number Using Pivot Year  
% Convert text representing a date to a serial date number using the default pivot year.   

%%  
n = datenum('12-jun-17','dd-mmm-yy') 

%%
% The text that represents this date number is |'12-Jun-2017'|.  

%% 
% Convert the same text to a serial date number using 1400 as the
% pivot year. 
n = datenum('12-jun-17','dd-mmm-yy',1400) 

%%
% The text that represents this date number is |'12-Jun-1417'|.