If anyone was looking for the same answer I have it here.
function enable = check_license
[~,b]=dos('ping -n 1 www.google.com');
n=strfind(b,'Lost');
n1=b(n+7);
if(n1=='0')
URL = 'http://tycho.usno.navy.mil/cgi-bin/timer.pl';
atomTime = datenum(regexp(urlread(URL), ...
'<BR>(.*)\sUTC','tokens','once'),'mmm. dd, HH:MM:SS');
%sysTime = now;
if atomTime > datenum('2017-01-01') % this code stops working Jan 1, 2017
waitfor(msgbox('Please update your License','License Expired')) ;
enable = 'off';
else
enable = 'on';
end
else
waitfor(msgbox('Please Connect To The Internet','No Internet Connection')) ;
enable = 'off';
end