Change language

PHP IntlCalendar equals () function

Syntax:
  • Object Oriented Style:
    bool IntlCalendar::equals (IntlCalendar  $other)
  • Procedural style:
    bool intlcal_equals (IntlCalendar $cal, IntlCalendar $other)
Parameters :
  • $cal:this parameter contains IntlCalendar resource.
  • $other:This parameter contains the calendar date and time to compare with the first time object.
Return value :This function returns TRUE if the current time of both IntlCalendar objects is the same, otherwise it returns FALSE.The following program illustrates the IntlCalendar::equals() function in PHP:Program :   
// Create IntlCalendar from a DateTime object or string $calendar1 = IntlCalendar::fromDateTime ( ’2019-03-21 09: 19: 29’ ); $calendar2 = IntlCalendar::fromDateTime ( ’2018-03-21 09: 19: 29’ );  
// Use the IntlCalendar::equals() function to compare the time
// from two IntlCalendar objects and displaying the result var_dump ( $calendar1 -> equals ( $calendar2 ));  
// Clone DateTime $calendar1 $calendar2 = clone $calendar1 ;  
// Use the IntlCalendar::equals() function to compare the time
// from two IntlCalendar objects and displaying the result var_dump ( $calendar1 -> equals ( $calendar2 ));  
// Create an IntlCalendar instance $calendar2 = IntlCalendar::createInstance (NULL, ’en_US’ );  
// Set DateTime $calendar2 to $calendar1 $calendar2 -> setTime ( $calendar1 -> getTime());  
// Use the IntlCalendar::equals() function to compare the time
// from two IntlCalendar objects and displaying the result var_dump ( $calendar1 -> equals ( $calendar2 ));  
// Clone DateTime $calendar1 $calendar2 = clone $calendar1 ;  
// Set DateTime $calendar2 to $calendar1 $calendar2 -> setTime ( $calendar1 -> getTime() - 10);  
// Use the IntlCalendar::equals() function to compare the time
// from two IntlCalendar objects and displaying the result var_dump ( $calendar1 -> equals ( $calendar2 ));  
?>
Exit:
bool (false ) bool (true) bool (true) bool (false)
Link: https://www.php.net/manual/en/intlcalendar.equals.php

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method