Change language

PHP IntlCalendar setTime () function

Syntax:
  • Object Oriented Style
    bool IntlCalendar::setTime (float $date)
  • Procedural style
    bool intlcal_set_time (IntlCalendar $cal, float $date )
Parameters:This function uses two parameters as above and described below:
  • $cal:this parameter contains the IntlCalendar resource.
  • $date:this parameter contains the moment, represented by the number of milliseconds between the instant and the time of the epoch. This ignores leap seconds.
Return Value:This function returns TRUE on success and FALSE on failure.The following program illustrates the function IntlCalendar::setTime() in PHP:Program:  
// Set date, time zone ini_set ( ’date.timezone’ , ’ Asia / Calcutta’ );  
// Create a DateTime object $cal = IntlCalendar::fromDateTime ( ’2019-03-21 09: 19: 29’ );  
// Format the DateTime object echo IntlDateFormatter::formatObject ( $cal , IntlDateFormatter::FULL), "" ;  
// Declare a new IntlGregorianCalendar object $cal = new IntlGregorianCalendar (2019, 8, 22, 10, 30, 34);  
// Format the DateTime object echo IntlDateFormatter::formatObject ( $cal , IntlDateFormatter::FULL), "" ;  
// Set the DateTime object $cal -> setTime ( strtotime ( ’2019-10-27 -05: 30: 00 GMT’ ) * 1000);  
// Format the DateTime object echo IntlDateFormatter::formatObject ( $cal , IntlDateFormatter::FULL);  
?>
Exit:
Thursday, March 21, 2019 at 9:19:29 AM India Standard Time Sunday, September 22, 2019 at 10:30:34 AM India Standard Time Thursday, January 1, 1970 at 5:30:00 AM India Standard Time
Link: https://www.php.net/manual/en/intlcalendar .settime.php

Shop

Best laptop for Sims 4

$

Best laptop for Zoom

$499

Best laptop for Minecraft

$590

Best laptop for engineering student

$

Best laptop for development

$

Best laptop for Cricut Maker

$

Best laptop for hacking

$890

Best laptop for Machine Learning

$950

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