d = datetime
13-Apr-2019 02:51:59
As an alternative, you can specify the TimeZone property after you create the array.
d.TimeZone = 'America/Los_Angeles'
d = datetime
12-Apr-2019 23:51:59
To see a complete list of time zones, use the timezones function.
Convert Zoned and Unzoned Datetime Values to Julian Dates
A Julian date is the number of days (including fractional days) since noon on November
24, 4714 BCE, in the proleptic Gregorian calendar, or January 1, 4713 BCE, in the
proleptic Julian calendar. To convert datetime arrays to Julian dates, use the
juliandate function.
Create a datetime array and specify its time zone.
DZ = datetime('2016-07-29 10:05:24') + calmonths(1:3);
DZ.TimeZone = 'America/New_York'
DZ = 1x3 datetime array
29-Aug-2016 10:05:24 29-Sep-2016 10:05:24 29-Oct-2016 10:05:24
Convert D to the equivalent Julian dates.
format longG
JDZ = juliandate(DZ)
JDZ = 1×3
2457630.08708333 2457661.08708333 2457691.08708333
Create an unzoned copy of DZ. Convert D to the equivalent Julian dates. As D has no time
zone, juliandate treats the times as UTC times.
D = DZ;
D.TimeZone = '';
JD = juliandate(D)
Convert Date and Time to Julian Date or POSIX Time