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

    %% Shift Current Date to Next Month
%%
% Define the current date.

% Copyright 2015 The MathWorks, Inc.

t = datetime('today')
%%
% Shift the date to the start of the next month.
t2 = dateshift(t,'start','month','next')
%%
% Shift the date to the end of the next month.
t2 = dateshift(t,'end','month','next')