Skip to content

incendium.date.compare

César Román edited this page Apr 30, 2024 · 8 revisions

Description

Compare two dates.

Syntax

incendium.date.compare(date_1, date_2)

Args:

  • date_1(Date): The first date.
  • date_2(Date): The second date..

Returns:

  • int: 0 if date_1 and date_2 are equal, -1 If date_2 is greater than date_1, 1 If date_1 is greater than date_2.

Recommendations

None.

Code Examples

from __future__ import print_function

import incendium.date
import system.date

date_1 = system.date.now()
date_2 = system.date.addDays(date_1, 7)

print(incendium.date.compare(date_1, date_2))  # Output: -1
Clone this wiki locally