PHP | IntlCalendar getTime() Function Last Updated : 25 Sep, 2019 Comments Improve Suggest changes Like Article Like Report The IntlCalendar::getTime() function is an inbuilt function in PHP which is used to return the time currently represented by the object. The time is expressed in terms of milliseconds since the epoch. Syntax: Object oriented style float IntlCalendar::getTime( void ) Procedural style float intlcal_get_time( IntlCalendar $cal ) Parameters: This function accepts single parameter $cal which holds the resource of IntlCalendar object. Return Value: This function returns a floating point number representing the milliseconds elapsed since the epoch (1 Jan 1970 00:00:00 UTC). Below program illustrates the IntlCalendar::getTime() function in PHP: Program: php <?php // Create an instance of calendar $calendar = IntlCalendar::createInstance(); // Get the current time var_dump($calendar->getTime()); // Create a new IntlGregorianCalendar $calendar = new IntlGregorianCalendar(2019, 9, 22, 12, 30, 56); // Get the current time var_dump($calendar->getTime()); // Create a DateTime object $calendar = IntlCalendar::fromDateTime('2019-03-21 09:19:29'); // Get the current time var_dump($calendar->getTime()); // Set the timezone $calendar->setTimeZone('GMT+05:30'); // Get the current time var_dump($calendar->getTime()); ?> Output: float(1569306894500) float(1571747456000) float(1553159969000) float(1553159969000) Reference: https://www.php.net/manual/en/intlcalendar.gettime.php Comment More infoAdvertise with us Next Article PHP | IntlCalendar getTime() Function J jit_t Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Intl Similar Reads PHP | IntlCalendar get() Function The IntlCalendar::get() function is an inbuilt function in PHP which is used to get the value for a specific field. Syntax: Object oriented style int IntlCalendar::get( int $field ) Procedural style int intlcal_get( IntlCalendar $cal, int $field ) Parameters: This function uses two parameters as men 2 min read PHP | IntlCalendar getTimeZone() Function The IntlCalendar::getTimeZone() function is an inbuilt function in PHP which is used to return the timezone object associated with this calendar. Syntax: Object oriented style IntlTimeZone IntlCalendar::getTimeZone( void ) Procedural style IntlTimeZone intlcal_get_time_zone( IntlCalendar $cal ) Para 2 min read PHP | IntlCalendar getType() Function The IntlCalendar::getType() function is an inbuilt function in PHP which is used to get the calendar type in terms of string. The "calendar" is the valid value of keywords. Syntax: Object oriented stylestring IntlCalendar::getType( void )Procedural stylestring intlcal_get_type( IntlCalendar $cal ) P 1 min read PHP | IntlCalendar inDaylightTime() Function The IntlCalendar::inDaylightTime() function is an inbuilt function in PHP which is used to check whether the object time is in Daylight Savings Time or not. Syntax: Object oriented style bool public IntlCalendar::inDaylightTime( void ) Procedural style bool intlcal_in_daylight_time( IntlCalendar $ca 1 min read PHP | IntlCalendar getLeastMaximum() Function The IntlCalendar::getLeastMaximum() function is an inbuilt function in PHP which is used to get the smallest local maximum for a field. The value should be smaller or equal to IntlCalendar::getActualMaxmimum() which is smaller or equal to IntlCalendar::getMaximum() return value. Syntax: Object orien 1 min read Like