👻 Check our latest review to choose the best laptop for Machine Learning engineers and Deep learning tasks!
Syntax:- Object Oriented Style
bool IntlCalendar::set (int $field, int $value)
orbool IntlCalendar::set (int $year, int $month, int $dayOfMonth = NULL, int $hour = NULL, int $minute = NULL, int $second = NULL)
- Procedural style
bool intlcal_set (IntlCalendar $cal, int $field, int $value)
orbool intlcal_set ( IntlCalendar $cal, int $year, int $month, int $dayOfMonth = NULL, int $hour = NULL, int $minute = NULL, int $second = NULL)
- $cal:This parameter contains the IntlCalendar object resource.
- $field:This parameter is Holds one of the constants of the IntlCalendar date / time field. Field constants are integer values ​​and range from 0 to IntlCalendar::FIELD_COUNT.
- $value:This parameter contains the new value for this field.
- $year:this parameter contains a new value for the IntlCalendar::FIELD_YEAR field.
- $month:this parameter contains a new value for the IntlCalendar::FIELD_MONTH field.
- $dayOfMonth:this parameter contains the new value for the IntlCalendar::FIELD_DAY_OF_MONTH field. Month sequence starts at zero, i.e. 0 for January, 1 for February, etc.
- $hour:this parameter contains a new value for the IntlCalendar::FIELD_HOUR_OF_DAY field .
- $minute:this parameter contains the new value for the IntlCalendar::FIELD_MINUTE field.
- $second:this parameter contains new value for the IntlCalendar::FIELD_SECOND field.
// Set DateTime Zone
ini_set
(
’date.timezone’
,
’ Asia / Calcutta’
);
ini_set
(
’date.timezone’
,
’UTC’
);
// Create an IntlCalendar instance
$calendar
= IntlCalendar::createInstance (
’Asia / Calcutta’
);
// Set the DateTime object
$calendar
-> set (2019, 8, 24);
// Show the calendar object
var_dump (IntlDateFormatter::formatObject (
$calendar
));
// Declare a new IntlGregorianCalendar object
$calendar
=
new
IntlGregorianCalendar (2016, 8, 24);
// Set the year field
$calendar
-> set (IntlCalendar::FIELD_YEAR, 2018);
// Show the calendar object
var_dump (IntlDateFormatter::formatObject (
$calendar
));
?>
Exit:string (24 ) "Sep 24, 2019, 8:23:53 AM" string (25) "Sep 24, 2018, 12:00:00 AM"
Link: https://www.php.net/manual/en/intlcalendar.set.php
👻 Read also: what is the best laptop for engineering students?
We hope this article has helped you to resolve the problem. Apart from PHP IntlCalendar set () function, check other calendar Python module-related topics.
Want to excel in Python? See our review of the best Python online courses 2023. If you are interested in Data Science, check also how to learn programming in R.
By the way, this material is also available in other languages:
- Italiano PHP IntlCalendar set () function
- Deutsch PHP IntlCalendar set () function
- Français PHP IntlCalendar set () function
- Español PHP IntlCalendar set () function
- Türk PHP IntlCalendar set () function
- Русский PHP IntlCalendar set () function
- Português PHP IntlCalendar set () function
- Polski PHP IntlCalendar set () function
- Nederlandse PHP IntlCalendar set () function
- 中文 PHP IntlCalendar set () function
- 한국어 PHP IntlCalendar set () function
- 日本語 PHP IntlCalendar set () function
- हिन्दी PHP IntlCalendar set () function
Javier Galleotti
London | 2023-03-22
Simply put and clear. Thank you for sharing. PHP IntlCalendar set () function and other issues with intl PHP module was always my weak point 😁. Will use it in my bachelor thesis
Olivia Ungerschaft
New York | 2023-03-22
Maybe there are another answers? What PHP IntlCalendar set () function exactly means?. Will get back tomorrow with feedback
Anna Schteiner
San Francisco | 2023-03-22
PHP is always a bit confusing 😭 PHP IntlCalendar set () function is not the only problem I encountered. I am just not quite sure it is the best method