📄 datmil.m
字号:
function [sdate,yyyy,mm,dd] = datmil(ndat)
%function[yyyymmdd] = datmil(ndat)
% ndat is a date number as given in the matlab datenum format
% and is turned into the military date format of yyyy/mm/dd
% Also gives the year, month, and day broken into pieces
%Jessica M. Cote, March 2000
%US Geological Survey
%Woods Hole, MA
[y,m,d] = datevec(floor(ndat));
yyyy = num2str(y);
if m < 10
mm = ['0' num2str(m)];
else
mm = num2str(m);
end
if d < 10
dd = ['0' num2str(d)];
else
dd = num2str(d);
end
sdate = [yyyy '/' mm '/' dd];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -