Contents
Overview.. 4
Release Log. 4
DP Functions. 4
1 - DP_AddDays. 4
2 - DP_AddHours. 5
3 - DP_AddMinutes. 5
4 - DP_AddMonths. 5
5 - DP_AddQuarters. 5
6 - DP_AddSeconds. 5
7 - DP_AddSemesters. 5
8 - DP_AddWeeks. 6
9 - DP_AddWorkdays. 6
10 - DP_AddYears. 6
11 - DP_BuildDateTime. 6
12 - DP_CurrDate. 6
13 - DP_CurrDateTime. 7
14 - DP_CurrTime. 7
15 - DP_DateTimeCeiling. 7
16 - DP_DateTimeFloor 7
17 - DP_NewDate. 7
18 - DP_NewDateTime. 8
19 - DP_NewTime. 8
20 - DP_1JanWeekDay. 8
21 - DP_BeginOfSemester 8
22 - DP_BeginOfTrimester 8
23 - DP_BeginOfWeek. 9
24 - DP_DateTimeToUnix. 9
25 - DP_DayOfWeek. 9
26 - DP_DayOfYear 9
27 - DP_DaysToYearEnd. 9
28 - DP_EasterDay. 10
29 - DP_EndOfMonth. 10
30 - DP_EndOfSemester 10
31 - DP_EndOfTrimester 10
32 - DP_MaxDate. 10
33 - DP_MaxDateTime. 11
34 - DP_MinDate. 11
35 - DP_MinDateTime. 11
36 - DP_NextWorkDay. 11
37 - DP_OrdWeekday. 11
38 - DP_UnixToDateTime. 12
39 - DP_DiffDays. 12
40 - DP_DiffHours. 12
41 - DP_DiffMilliSeconds. 12
42 - DP_DiffMinutes. 12
43 - DP_DiffMonths. 13
44 - DP_DiffQuarters. 13
45 - DP_DiffSeconds. 13
46 - DP_DiffSemesters. 13
47 - DP_DiffTrimesters. 13
48 - DP_DiffWeeks. 13
49 - DP_DiffWorkDays. 14
50 - DP_DiffYears. 14
51 - DP_GetCentury. 14
52 - DP_GetDate. 14
53 - DP_GetDay. 14
54 - DP_GetHour 15
55 - DP_GetMinute. 15
56 - DP_GetMonth. 15
57 - DP_GetQuarter 15
58 - DP_GetSecond. 15
59 - DP_GetSemester 16
60 - DP_GetTime. 16
61 - DP_GetTrimester 16
62 - DP_GetUnixMilliSeconds. 16
63 - DP_GetUnixSeconds. 16
64 - DP_GetWeek. 17
65 - DP_GetYear 17
66 - DP_IsDate. 17
67 - DP_IsDateTime. 17
68 - DP_IsLeapYear 17
69 - DP_IsTime. 18
70 - DP_IsWorkDay. 18
Version 3
Data Plus (DP) offers a comprehensive set of 70 Client and similar number of Server functions designed to extend the built-in DateTime functions, all within a single solution. Over half of these functions are entirely new and are not available in OutSystems' standard built-in functions. The remaining functions include enhanced versions of existing ones, unified with consistent terminology for easier usability and recall. All DP function names begin with DP_*, ensuring they are easy to identify.
The functions are organized into thematic folders, grouping them logically based on their purpose:
This structure helps users quickly navigate through the library, find relevant functions, and streamline their work. Future updates will include additional functions while maintaining the current naming convention. The current version includes a total of 70 DT functions.
2.0.4
Add new functions
DP_DateTimeToUnix
DP_UnixToDateTime
DP_BeginOfWeek
Minor corrections and enhancements
In order to keep a homogeneous naming system function, all functions start with DP_*.
Description :
Add Days to DataTime.
Function Group :
Add
Input :
<DateTime1> , <Integer>
Output :
<DataTime>
Example :
DP_AddDays(#2024-08-22 10:23:40#, 1) > #2024-08-23 10:23:40#
Notes :
Versions: Client function, Server function, Warped Function
Add Hours to DataTime.
DP_AddHours(#2024-08-22 10:23:40#, 1) > #2024-08-22 11:23:40#
Add Minutes to DateTime.
DP_AddMinutes(#2024-08-22 10:23:40#, 1) > #2024-08-22 10:24:40#
Add Months to DateTime.
DP_AddMonths(#2024-08-22 10:23:40#, 1) > #2024-09-22 10:23:40#
Add Quarters to DataTime.
DP_AddQuarters(#2024-08-22 10:23:40#, 1) > #2024-11-22 10:23:40#
Versions: Client function, Server function,
Add Seconds to DateTime.
DP_AddSeconds(#2024-08-22 10:23:40#, 12) > #2024-10-22 10:23:52#
Add Semesters to DataTime.
DP_AddSemester(#2024-08-22 10:23:40#, 1) > #2025-04-22 10:23:40#
Add Weeks to DateTime.
<DataTime1> , <Integer>
DP_AddWeeks(#2024-08-22 10:23:40#, 1) > #2024-08-27 10:23:40#
DateTime after n works days.
Workdays > Monday to Friday.
Holidays not consider
<DateTime>
DP_AddWorkdays(#2024-08-22 10:23:40#, 1) > #2024-08-23 10:23:40#
DP_AddWorkdays(#2024-08-22 10:23:40#, 2) > #2024-08-26 10:23:40#
Add Years to DataTime
DP_AddYears(#2024-08-22 10:23:40#, 1) > #2025-08-22 10:23:40#
Concatenated Date and Time parts.
Build
<Date1> , <Time1>
DP_BuildDateTime(#2024-04-12#,#10:29:15#) > #2024-04-12 10:29:15#
Output Current Date.
<Date>
DP_CurrDate() > #2024-08-12#
Output Current DateTime.
DP_CurrDateTime() > #2024-08-12 10:23:20#
Output Current Time.
<Time>
DP_CurrTime() > #10:23:20#
Output the insert Date with time 23:59:59.
<Date1>
DP_DateTimeCeiling(#2024-04-02#) > #2024-04-02 23:59:59#
Output the insert Date with time 00:00:00.
DP_DateTimeFloor(#2024-04-02#) > #2024-04-02 00:00:00#
Output a Date with input of y, m, d.
<Integers> , <3>
DP_NewDate(2024,02,27) > #2024-02-27 00:00:00#
Output a Date with input of y, m, d, h, m, s.
<Integers> , <6>
DP_NewDateTime(2024,3,23,22,20,3) > #2024-03-23 22:20:03#
Output a time with input h,m,s.
DP_NewTime(22,20,3) > #22:20:03#
Output the ordinary day of week [1-7] of 1st day of Year.
ISO Version. 1:Monday – 7:Sunday
Calculate
<Year (Int)>
<Integer>
DP_1JanWeekDay(2024) > 1
DP_1JanWeekDay() > 1
Output the date of First day of a Semester.
<Semester (Int)> , <Year>
DP_BeginOfSemester(2,2024) > #2024-07-01 00:00:00#
DP_BeginOfSemester(2) > #2024-07-01 00:00:00#
Year not mandatory (default: Present Year)
Output the date of First day of a Trimester.
<Trimester (Int)> , <Year>
DP_BeginOfTrimester(2,2024) > #2024.04.01 00:00:00#
DP_BeginOfTrimester(2) > #2024.04.01 00:00:00#
Output DateTime of a Week of input Year
<Integer> , <Year>
DP_BeginOfWeek(7,2025) > #2025-02-10#
Convert DateTime to Unix epoch time (seconds)
<DateTime1>
<LongInteger>
DP_DateTimeToUnix(#2025-02-10 17:41#) > 1739209260
Versions: Client function, ,
Output the ordinary day of week [1-7].
DP_DayOfWeek(#2024-03-30#) > 6
Output the ordinary day of year [1-366].
DP_DayOfYear(#2024-03-31#) > 91
Output the number of days to end of Year 365-0.
DP_DaysToYearEnd(#2024-03-31#) > 275
Calculate to easter sunday.
DP_EasterDay(2004) > #2024-03-31#
Output the last day of a month, if not input the year the action actual year
<Month (Int)> , <Year (Int)>
DP_EndOfMonth(3,2024) > #2024-03-31#
Output the date of Last day of a Semester.
DP_EndOfSemester(1,2024) > #2024-06-30#
Output the date of Last day of a Trimester.
DP_EndOfTrimester(1,2024) > #2024-03-31#
Output the largest date.
<Date1> , <Date2>
DP_MaxDate(#2024-04-02#,#2024-04-10#) > #2024-04-10#
Output the largest date of two DateTime.
<DateTime1> , <DateTime2>
DP_MaxDateTime(#2024-02-27 00:00:00#,#2024-04-28 00:23:00#) > #2024-04-28 00:23:00#
Output the smallest date.
DP_MaxDate(#2024-04-02#,#2024-04-10#) > #2024-04-02#
Output the smallest date of two DateTime.
DP_MinDateTime(#2024-02-27 00:00:00#,#2024-04-28 00:23:00#) > #2024-02-28 00:00:00#
Output the next workday DateTime. Holidays not consider.
DP_NextWorkDay(#2024-04-02 23:10:05#) > #2024-04-03 23:10:05#
Output the Date of a selected weekday in a pos week
<Pos (int)> , <Weekday (int)>
DP_OrdWeekday(1,3,1,2025) > #2025-01-01#
DP_OrdWeekday(-1,1,1,2025) > #2025-01-27#
DP_OrdWeekday(1,1,1,2025) > #2025-01-06#
Pos = -1 for last week of month
Convert Unix epoch Time (seconds) to DateTime
<Integers>
DP_UnixToDateTime(500) >
Output the number of days between two DateTimes.
Diff
DP_DiffDays(#2024-02-27 00:00:00#,#2024-04-28 00:00:00#) > 38
Output the number of hours between two DateTimes.
DP_DiffHours(#2024-02-27 00:00:00#,#2024-04-28 00:00:00#) > 912
DP_DiffHours(#2024-02-27 00:00:00#,#2024-04-28 03:00:00#) > 915
Output the number of milliseconds between two unix date.
Difference between one value with actual unix time.
DP_DiffMilliSeconds(1729785716168) > 23000
Returns the difference of milliseconds between two date times with milliseconds.
Output the number of minutes between two DateTimes.
DP_DiffMinutes(#2024-02-27 00:00:00#,#2024-02-28 00:00:00#) > 1140
Output the number of months between two DateTimes.
DP_DiffMonths(#2024-02-27 00:00:00#,#2024-03-28 00:00:00#) > 1
Output the number of quarter between two DateTimes.
DP_DiffQuarters(#2024-01-27 00:00:00#,#2024-04-28 00:00:00#) > 1
Output the number of seconds between two DateTimes.
DP_DiffSeconds(#2024-02-27 00:00:00#,#2024-02-28 00:00:00#) > 68400
Output the number of semesters between two DateTimes.
DP_DiffSemesters(#2024-01-27 00:00:00#,#2024-04-28 00:00:00#) > 0
Output the number of trimesters between two DateTimes.
<DataTime1> , <DateTime2>
DP_DiffTrimesters(#2024-01-27 00:00:00#,#2024-04-28 00:00:00#) > 1
Output the number of full weeks between two DateTimes.
DP_DiffWeeks(#2024-02-27 00:00:00#,#2024-03-28 00:00:00#) > 4
Output the number of workdays between two DateTimes.
DP_DiffWorkDays(#2024-02-27 00:00:00#,#2024-04-28 00:00:00#) > 32
Not considers holidays
Output the number of years between two DateTimes.
DP_DiffYears(#2024-02-27 00:00:00#,#2024-04-28 00:00:00#) > 0
Output the century of input DateTime.
Get
DP_GetDate(#2024-04-02 23:10:05#) > #2024-04-02#
Output the Date part of a DataTime.
DP_GetCentury(#2024-04-02 23:10:05#) > 22
Output the day part of DateTime.
DP_GetDay(#2024-04-02 23:10:05#) > 2
Output the hours part of DateTime.
DP_GetHour(#2024-04-02 23:10:05#) > 23
Output the minutes part of DateTime.
DP_GetMinute(#2024-04-02 23:10:05#) > 10
Output the month part of DateTime.
DP_GetMonth(#2024-04-02 23:10:05#) > 4
Output the quarter of a DateTime.
DP_GetQuarter(#2024-04-02 23:10:05#) > 2
Output the seconds part of DateTime.
DP_GetSecond(#2024-04-02 23:10:05#) > 5
Output the semester of a DateTime.
DP_GetSemester(#2024-04-02 23:10:05#) > 1
Output the Time part of a DataTime.
DP_GetTime(#2024-04-02 23:10:05#) > #23:10:05#
Output the trimester of a DateTime.
DP_GetTrimester(#2024-04-02 23:10:05#) > 2
Output current date time (UTC) with UNIX milliseconds
Since Jan 1, 1970 00:00:00 UTC
DP_GetUnixMilliSeconds() > 1729785716168
JavaScript Returns current date time with milliseconds with milliseconds on UTC
Output current date time (UTC) with UNIX seconds
DP_GetUnixSeconds() > 1729785716
JavaScript Returns current date time with seconds with seconds on UTC
Output the ISO Week Number [1-53].
DP_GetWeek(#2024-04-02 23:10:05#) > 14
Output the year part of DateTime
DP_GetYear(#2024-04-02 23:10:05#) > 2024
Check if Date format
Logical
<Date (Text)>
<Logic>
DP_IsDate("2024-04-02") > True
Check if DateTime format
<DateTime (Text)>
DP_IsDateTime("2024-04-02 22:12:00") > True
Checks if the year is a Leap Year
DP_IsLeapYear(2024) > True
Check if Time format
<Time (Text)>
DP_IsTime("22:12:00") > True
Checks if the day is a workday
DP_IsWorkDay(#2024-02-27 00:00:00#) > True
Add Seconds to DateTime
Add Semesters to DataTime
Add Weeks to DateTime
<Date> , <Time>
Output the insert Date with time 23:59:59
Output the insert Date with time 00:00:00
Output a Date with input of y, m, d
Output a Date with input of y, m, d, h, m, s
Output a time with input h,m,s
Output the Date of a selected weekday
DP_OrdWeekday(2,2,5,2024) > #2004-05-14#
DP_OrdWeekday(-1,2,5,2024) > #2004-05-28#
DP_OrdWeekday(0,2,5,2024) > #1900-01-01#
Output the semester of a DateTime