4.0

4.0 | 2 ratings Rate this file 15 Downloads (last 30 days) File Size: 13.37 KB File ID: #11469

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

by Nicolas BERCHER

 

20 Jun 2006 (Updated 20 Jun 2006)

Get a UTC time using standard C time function, convert UTC time to MATLAB serial date ...

| Watch this File

File Information
Description

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.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Get UTC Time, Convert a UTC time to Datenum (supports vectors, Win/Linux)
This submission has inspired the following:
Convert Time Array to a Datenum Array (Win32)

MATLAB release MATLAB 7.0.1 (R14SP1)
Other requirements Available for Win32 and Linux platforms.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
21 Jun 2006 Richard Sonnenfeld

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

07 Mar 2007 Colin Foss

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

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
clock Nicolas BERCHER 22 Oct 2008 08:30:03
fun Nicolas BERCHER 22 Oct 2008 08:30:03
datenum utc linux windows mex Nicolas BERCHER 22 Oct 2008 08:30:03

Contact us at files@mathworks.com