Be the first to rate this file! 120 downloads (last 30 days) File Size: 5.07 KB File ID: #22295

local_time_to_utc

by Peter Tenenbaum

 

02 Dec 2008

Convert local time to UTC

Download Now | Watch this File

File Information
Description

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.

MATLAB release MATLAB 7.4 (R2007a)
Other requirements Java classes text.SimpleDateFormat, util.Date, util.TimeZone
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com