File Exchange

image thumbnail


version (2.77 KB) by Peter Tenenbaum
Convert local time to UTC


Updated 02 Dec 2008

View License

This function converts local time to UTC via Java methods. It is therefore portable to Matlab on any platform. It can take as argument either a vector of datenums or a vector of datevecs (ie, local_time_to_utc(now) or local_time_to_utc([2008 01 01 00 00 00])). It formats the returned time as a Matlab date/time string with a post-pended 'Z' to indicate UTC.

Cite As

Peter Tenenbaum (2020). local_time_to_utc (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Excellent contribution. Many thanks. Can also get UTC from an URL

It's a pity I found this submission only after having written my own one (inferior to this one, since only working on Windows).

Tim Scott

Exactly what I was looking for. Thanks!

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: skychart