Rank: 3499 based on 29 downloads (last 30 days) and 1 file submitted
photo

Erwin Mayer

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Erwin
Updated   File Tags Downloads
(last 30 days)
Comments Rating
19 Jun 2010 Screenshot Convert between world time zones with daylight saving times This is a very simple yet powerful function to convert a datenum from one timezone to another. Author: Erwin Mayer communications, gmt, local time, time zone, time zones, travel 29 19
  • 4.0
4.0 | 6 ratings
Comments and Ratings by Erwin View all
Updated File Comments Rating
27 Mar 2013 Convert between world time zones with daylight saving times This is a very simple yet powerful function to convert a datenum from one timezone to another. Author: Erwin Mayer

Hello Scott, I would be happy to help more, unfortunately I don't have Matlab installed right now, and I would greatly suggest to use the Joda Time library instead, to perform the same task as in my original script:
http://joda-time.sourceforge.net/
I have been using the C# port Noda Time lately and it is perfectly suited for this kind of tasks.

@Benjamin, this library would also be more reliable to avoid the kind of rounding errors you have observed.

22 Mar 2013 Convert between world time zones with daylight saving times This is a very simple yet powerful function to convert a datenum from one timezone to another. Author: Erwin Mayer

Scott: Yes, it requires the financial toolbox.

04 Aug 2011 Convert between world time zones with daylight saving times This is a very simple yet powerful function to convert a datenum from one timezone to another. Author: Erwin Mayer

Hi Justinas, it should adjust historical time for the DST, that was the purpose. At least provided the functions from the Java package support them (probably not for dates very far away) Let me know if it does not work with a special case.

07 Jul 2010 Convert between world time zones with daylight saving times This is a very simple yet powerful function to convert a datenum from one timezone to another. Author: Erwin Mayer

Hi K E, from what I could see these functions are normally part of the Financial Toolbox. Aren't they enabled by default?

21 Jun 2010 World Time Zones Convert between local time and UTC. Get local time in various places in the world. Author: Bill McKeeman

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.

Comments and Ratings on Erwin's Files View all
Updated File Comment by Comments Rating
26 Dec 2013 Convert between world time zones with daylight saving times This is a very simple yet powerful function to convert a datenum from one timezone to another. Author: Erwin Mayer Ricardo

Here's a suggestion for a vectorized version of this function:

function time = convertTZone(time, TZoneOld, TZoneNew)

OffSet = now - TimezoneConvert(now, TZoneOld, TZoneNew);
time = time - OffSet;

end

10 Oct 2013 Convert between world time zones with daylight saving times This is a very simple yet powerful function to convert a datenum from one timezone to another. Author: Erwin Mayer Wouters, Dennis

@Scott, I applied your 'fix', but do not observe your issue.

t1 = datestr(TimezoneConvert(datenum('31-Mar-2013 00:59:59'),'UTC','Europe/Berlin'))
t2 = datestr(TimezoneConvert(datenum('31-Mar-2013 01:00:00'),'UTC','Europe/Berlin'))

Results in:
t1 =
31-Mar-2013 01:59:59
t2 =
31-Mar-2013 03:00:00

as expected.
So I think your fix is ok.

02 Aug 2013 Convert between world time zones with daylight saving times This is a very simple yet powerful function to convert a datenum from one timezone to another. Author: Erwin Mayer Justinas

Hi, currently the function supports only one date conversion, due to Calendar.set method limitations.
How could I modify it to make fast conversions for multiple dates? i.e.if dn would be a vector.

03 Jun 2013 Convert between world time zones with daylight saving times This is a very simple yet powerful function to convert a datenum from one timezone to another. Author: Erwin Mayer janez

Great tool. A word of warning though: as noticed by Matt Aldrich it doesn't accept multidimensional arrays. But if you loop sequentially over all array elements (datenumbers) it works like a charm.

27 Mar 2013 Convert between world time zones with daylight saving times This is a very simple yet powerful function to convert a datenum from one timezone to another. Author: Erwin Mayer Mayer, Erwin

Hello Scott, I would be happy to help more, unfortunately I don't have Matlab installed right now, and I would greatly suggest to use the Joda Time library instead, to perform the same task as in my original script:
http://joda-time.sourceforge.net/
I have been using the C# port Noda Time lately and it is perfectly suited for this kind of tasks.

@Benjamin, this library would also be more reliable to avoid the kind of rounding errors you have observed.

Contact us