You may consider (1) Simulink block:
Also, (2) this RTC fcn: https://www.mathworks.com/matlabcentral/fileexchange/3522-rtc-a-pedestrian-real-time-clock-figure
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!