Reference > DSTStyle Object > DSTStyle Object Properties > EndDay Property (DSTStyle) |
EndDay Property (DSTStyle)
Sets/returns the day on which Daylight Savings Time (DST) ends.
object.EndDay= integer
Read/Write at run time. Not available at design time.
0 - 31 (default 30)
You can use this property to set an exact ending date for the DST within a month. The month is determined by the EndMonth property:
Dim objTZ As New TDBTZoneX6Lib.TDBTZoneX
Dim DSTS As TDBTZoneX6Lib.DSTStyle
' Add a new DSTStyle object
Set DSTS = objTZ.DSTStyles.Add(, "CN")
With DSTS
.EndMonth = dbiOctober
.EndDay = 25
End With
However, if set to 0, the EndWeekday and the EndWhichWeek properties will be primarily used to determine the ending date. For example:
With DSTS
.EndMonth = dbiOctober
.EndDay = 0
.EndWeekday = dbiSunday
.EndWhichWeek = dbiLastWeek
End With
If setting a day which is larger than the amount of the month specified by the EndMonth property, the EndDay property will be automatically adjusted to the largest day in the month without any error occurring. In the case of February, the EndDay property will always be adjusted to 28 and the leap year will be handled internally by the object. For example:
With DSTS
.EndMonth = dbiSeptember
.EndDay = 31
End With
Debug.Print DSTS.EndDay
' Result
30
With this code, the EndDay property will automatically be adjusted to 30.
See Also