I am using an API to bring data into Matlab, and the timestamps are in UNIX time format. It also returns the local time zone for the data. UNIX time is based on UTC, so it convert it into a usable timestamp, I need to consider the UTC offset for the given time zone. The problem is, I can't seem to find a way to input a time zone to Matlab and have it output a UTC offset. I know that this information is available, because you can use tzoffset. But that requires a datetime input. Which puts me into a kind of catch-22. In order to convert to a datetime, I need the UTC offset. But to get the UTC offset, I need a datetime.
Is there any function that will tell me the UTC offset if I give it a timezone?
Best Answer