Get UTC Time, Convert a UTC time to Datenum (supports vectors, Win/Linux)
by Abraham Cohn
23 Mar 2005
(Updated 28 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, UTC does not depend on 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 in local time, accounting for Daylight Savings. This is done with the help of the C-function gmtime. Vectors are supported. The difference of the local time from UTC is also provided as an output. |
| Acknowledgements |
This submission has inspired the following:
Get UTC Time, Convert a UTC time to Datenum (both Win32/Linux versions), Convert Time Array to a Datenum Array (Win32)
|
| MATLAB release |
MATLAB 7.2 (R2006a)
|
| Other requirements |
MEXW32 files included for Windows.
mexCompile script to build for Linux is included. |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (8) |
| 04 May 2005 |
Bulent Bayraktar
|
|
|
| 11 Oct 2005 |
K Reese
|
|
|
| 08 Jun 2006 |
Richard Sonnenfeld
|
|
|
| 21 Jun 2006 |
Richard Sonnenfeld
|
|
|
| 03 Nov 2006 |
ralph habib
|
|
|
| 15 Aug 2007 |
Klaps Jos
|
|
|
| 16 Aug 2007 |
Abraham Cohn
|
|
|
| 15 Jul 2009 |
Albert Steiner
|
|
|
| Updates |
| 28 Jun 2006 |
By Request:
* Supports VECTORS
* No message to console (time zone diff is provided in 2nd output argument)
* Better help text for troubleshooting local time
* Includes compile script for Linux (mexCompile), courtesy of Nicholas Bercher |
|
Contact us at files@mathworks.com