File Exchange

image thumbnail

Get UTC Time, Convert a UTC time to Datenum (both Win32/Linux versions)

version (13.4 KB) by Nicolas BERCHER
Get a UTC time using standard C time function, convert UTC time to MATLAB serial date ...

1 Download

Updated 20 Jun 2006

View License

UTC time (universal time convention) is used in ANSI-C standard for defining time. This is measured in seconds since 1970, at the Prime Meridian. By definition, there is no adjustment in this number for Daylight Savings time. the UTC_TIME function uses a C-MEX function to get the System Time in UTC format.

Another function UTC2DATENUM will convert any UTC time to the correct MATLAB serial date number. This is done with the help of the C-function gmtime. Because this function should properly handle daylight savings time adjustments going from UTC to the local time used by the MATLAB serial date number.

This package just brings a Linux compatibility.

Cite As

Nicolas BERCHER (2021). Get UTC Time, Convert a UTC time to Datenum (both Win32/Linux versions) (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Colin Foss

This doesn't appear to generate properly for the new DST rules in effect in the US.

Richard Sonnenfeld

Nice Job -- Nicholas! I confirm it works as advertised.

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

Community Treasure Hunt

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

Start Hunting!