Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Comparing a Date value to a DateTime value

Updated on April 29, 2020

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.


Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us