Created
December 13, 2016 12:25
-
-
Save sandyUni/257e04a6bdfdf5844d7b5726e48b290c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [str] = timestrForFile( num ) | |
% generate a timestamp for file | |
% this time stamp has eliminated charactors forbidden in filename | |
% num is a num for time stamp, now is the default. | |
if nargin==0 | |
num = now; | |
end | |
timestr = datestr(num); | |
timestr= regexprep (timestr,':','-'); | |
str = regexprep (timestr,'\s','-'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment