-
Notifications
You must be signed in to change notification settings - Fork 33
LC0083
Arthur van de Vondervoort edited this page Feb 4, 2025
·
7 revisions
Embrace the modernized Date, Time, and DateTime APIs by using the new, more intuitive methods for extracting specific parts of these types. These updated methods improve code readability and maintainability compared to the older, less descriptive alternatives.
Type | New method | Existing | Description |
---|---|---|---|
Date | MyDate.Day() | Date2DMY(MyDate, 1) | Gets the day of month from MyDate |
Date | MyDate.Month() | Date2DMY(MyDate, 2) | Gets the month from MyDate |
Date | MyDate.Year() | Date2DMY(MyDate, 3) | Gets the year from MyDate |
Date | MyDate.DayOfWeek() | Date2DWY(MyDate, 1) | Gets the day of week from MyDate |
Date | MyDate.WeekNo() | Date2DWY(MyDate, 2) | Gets the week number from MyDate |
Date | MyDate.Year() | Date2DWY(MyDate, 3) | Gets the year from MyDate |
Time | MyTime.Hour() | Evaluate(i, Format(Time, 2, '<HOURS24>')) | Gets the hours MyTime (0..23). |
Time | MyTime.Minute() | Evaluate(i, Format(Time, 2, '<MINUTES>')) | Gets the hours MyTime (0..59). |
Time | MyTime.Second() | Evaluate(i, Format(Time, 2, '<SECONDS>')) | Gets the hours MyTime (0..59). |
Time | MyTime.Millisecond() | Evaluate(i, Format(Time, 3, '<THOUSANDS>')) | Gets the hours MyTime (0..999). |
DateTime | MyDateTime.Date() | DT2Date(MyDateTime) | Gets the date part of MyDateTime |
DateTime | MyDateTime.Time() | DT2Time(MyDateTime) | Gets the time part of MyDateTime |