To include a timezone on a timetable in MATLAB, you can use datetime
arrays. Here is an example:
main.m187 chars6 lines
In this example, time
is a datetime
array that includes the time zone information for New York. The timetable
function is then used to create a timetable with time
as one of its columns.
You can also add a time zone to an existing timetable by adding a column of datetime
arrays with time zone information. For example:
main.m300 chars8 lines
In this example, the Timezone
property of the timetable is set to the time zone for Los Angeles. This property is then used to create a column of datetime
arrays with the same time zone. Finally, the Time
column of the timetable is converted to datetime
arrays with the appropriate time zone using the datetime
function.
gistlibby LogSnag