Comparing a Date value to a DateTime value
You can compare a Date value and a DateTime value to see if a date is the same day as a DateTime value, for example, pxCreateDateTime. You can compare the values by using one of the following methods:
- Perform a string comparison of the first eight characters of the two values. You can do this because both property modes are in the format YYYYMMDD.
- Call the standard function DateValue(), which takes a DateTme property and returns the date portion of the property (without performing a time zone conversion), and compare the result of that function with the Date value.
Because DateTime and Date modes have different characteristics, it is not always possible to compare them so that the outcome is acceptable in all cases.
- A Date property represents an abstract date without the notion of time zone, which means that it is an absolute day, which means different things in different regions of the world.
- A DateTime property represents a specific day and time in a specific time zone, typically GMT.
Published February 2, 2006 — Updated May 15, 2018