5.0

5.0 | 2 ratings Rate this file 22 Downloads (last 30 days) File Size: 6.98 KB File ID: #22223
image thumbnail

World Time Zones

by Bill McKeeman

 

24 Nov 2008 (Updated 09 Nov 2009)

Convert between local time and UTC. Get local time in various places in the world.

| Watch this File

File Information
Description

This application is based on a large table of places (cities, states, provinces,states) and their time zones. The methods are:
  t = timeZones() construct time converter object
  tz = t.zone(place) find a time zone (-11 to +12)
  tm = t.st2utc(time, place) convert local standard time to UTC
  tm = t.dst2utc(time, place) convert local daylight time to UTC
  tm = t.utc2st(time, place) convert utc to local standard time
  tm = t.utc2dst(time, place) convert utc to local daylight time
  t.places() all places for which time is tabulated

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
07 Nov 2009 Arvind Ananthan

This is a pretty useful class for doing all sorts of UTC time computations.

07 Nov 2009 Arvind Ananthan

The constructor errors out in R2009b release!
??? Undefined function or method 'ctranspose' for input arguments of type 'function_handle'.
Error in ==> timeZones>public at 601
    o = struct(...
Error in ==> timeZones at 490
  tobj = public(); % prepare public interface
 

27 Nov 2009 Patrick Leung

This is very useful. However, how would one incorporate daylight saving? Is there a daylight saving library somewhere?

29 Nov 2009 Bill McKeeman

Patrick, I considered DST, and implemented entries in case the use knew DST was in effect. Tabulating DST, even for the U.S., required knowing geographical boundaries for the surprisingly varied laws regulating time. Such an effort was well beyond my own needs, and probably more work than payoff except for customers like AMTRAK. I would be interested in someone else trying it, but not me.

21 Jun 2010 Erwin Mayer

Hello,

I have written a timezone converter that takes into account DST.
Check it out here: http://www.mathworks.com/matlabcentral/fileexchange/27953

It makes use of the Calendar Class in Java.

24 Aug 2010 Tanyer Alan  
14 Feb 2011 David

Re: Erwin Mayer's contribution

But requires the Financial Toolbox

Please login to add a comment or rating.
Updates
11 Apr 2009

Implemented workaround for problem found in 2009a.

24 Jun 2009

removed screen shot

09 Nov 2009

Somehow a floating ' got into the source file. Sorry

Tag Activity for this File
Tag Applied By Date/Time
communications Bill McKeeman 24 Nov 2008 15:06:23
travel Bill McKeeman 24 Nov 2008 15:06:23
time zones Bill McKeeman 24 Nov 2008 15:06:23
local time Bill McKeeman 24 Nov 2008 15:06:23
utc Bill McKeeman 24 Nov 2008 15:06:23
gmt Bill McKeeman 24 Nov 2008 15:06:23
time zone Peter Cotton 21 Jan 2010 12:16:17
local time David Longin 26 Jul 2010 03:27:21
local time Walter 26 Aug 2011 14:38:34
gmt Ognyan Kounchev 08 Feb 2012 17:18:16

Contact us at files@mathworks.com