File Exchange

image thumbnail

getutc(timezone)

version 1.1.0.0 (1.23 KB) by Qun HAN
Retrieve the current UTC time and convert it to a MATLAB datenum.

6 Downloads

Updated 03 Sep 2017

View Version History

View License

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.

Cite As

Qun HAN (2020). getutc(timezone) (https://www.mathworks.com/matlabcentral/fileexchange/53999-getutc-timezone), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Michael Gebhard

works fine, Thanks!

hypmfrcl

Fails.....

Jan

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.

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!