This function can get the current Coordinated Universal Time from the time server "http://time.is/UTC" and returns it as a serial date number (datenum). The user can specify the time zone.
Qun HAN (2021). getutc(timezone) (https://www.mathworks.com/matlabcentral/fileexchange/53999-getutc-timezone), MATLAB Central File Exchange. Retrieved .
works fine, Thanks!
This function has a nice and very useful help section.
It would be worth to mention in addition, that the result is not determined by using the local clock, but by a obtaining the current time from web service. Therefore the replied time can be more accurate than CLOCK - but it is possible also, that it is *less* accurate: When the local clock is managed by NTP, the latency of the net and local computation is compensated, see https://en.wikipedia.org/wiki/Network_Time_Protocol . Perhaps this can be included partially in your submission also? Or perhaps you could trust the difference to the local CLOCK in rounded hours, but take local value of seconds and minutes for the output?
The line "floor(timezone);" is useless, whithout assigning the result.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!