This blocks computes the unix time stamp, date and time
and the day of the week based on the Modelica
variable time
.
As for the weather data reader
IBPSA.BoundaryConditions.WeatherData.ReaderTMY3,
time=0
corresponds to January 1st at midnight
in the local time zone.
The computed outputs are thus also for the local time zone.
The year for which time=0
is determined by
the parameter zerTim
.
The unix time stamp corresponding to the current time is computed.
From this variables the corresponding, year, date and time are computed using functions
such as floor()
and ceil()
.
The implementation only supports date computations from year 2010 up to and including 2020. Daylight saving is not supported.
The user must define which time and date correspond to time = 0
using the model parameters zerTim
, and, if
zerTim==IBPSA.Utilities.Time.Types.ZeroTime.Custom
,
the parameter yearRef
.
When zerTim==IBPSA.Utilities.Time.Types.ZeroTime.UnixTimeStampGMT
,
time
is defined with respect to GMT. This is different from the use
of time
in the weather data reader
IBPSA.BoundaryConditions.WeatherData.ReaderTMY3, as the weather data files
used with this reader are generally defined with time
being local time.
If zerTim==IBPSA.Utilities.Time.Types.ZeroTime.UnixTimeStampGMT
is used,
then the weather data files read by
IBPSA.BoundaryConditions.WeatherData.ReaderTMY3
must also be defined with GMT as the time stamp.
The user can choose from new year, midnight for a number of years:
2010 to 2030 and also 1970.
The latter corresponds to a unix stamp of 0.
(Note that when choosing the reference time equal to 0 at 1970,
the actual simulation time must be within the 2010-2030 range.
For instance startTime = 1262304000
corresponds
to the simulation starting on the 1st of January 2010
when setting zerTim = ZeroTime.UnixTimeStamp
.
This is within the 2010-2020 range and is therefore allowed.)
The unix time stamp is formally defined as the number of
seconds since midnight of new year in 1970 GMT.
To output the correct unix time stamp, set outputUnixTimeStamp=true
We then require the local time zone timZon
(see
IBPSA.BoundaryConditions.WeatherData.ReaderTMY3)
since time
uses the local time zone instead of GMT.
We always output unixTimeStampLocal
, which is a time stamp
that uses the local time zone reference instead of GMT.
The model was implemented such that no events are being generated for computing the minute of the day.
The model also contains an implementation for setting time=0
for any day and month other than January first.
This is however not activated in the current model since these options may wrongly give the impression
that it changes the time based on which the solar position is computed and TMY3 data are read.
time
is better explained
and unix time stamps are correctly defined with respect to GMT.
(see #1192).