|
dolibarr 24.0.0-beta
|
Set of function to manipulate dates. More...
Go to the source code of this file.
Functions | |
| get_tz_array () | |
| Return an array with timezone values. | |
| getServerTimeZoneString () | |
| Return server timezone string. | |
| getServerTimeZoneInt ($refgmtdate='now') | |
| Return server timezone int. | |
| dol_time_plus_duree ($time, $duration_value, $duration_unit, $ruleforendofmonth=0) | |
| Add a delay to a date. | |
| convertTime2Seconds ($iHours=0, $iMinutes=0, $iSeconds=0) | |
| Convert hours and minutes into seconds. | |
| convertSecondToTime ($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7) | |
| Return, in clear text, value of a number of seconds in days, hours and minutes. | |
| convertDurationtoHour ($duration_value, $duration_unit) | |
| Convert duration to hour. | |
| dolSqlDateFilter ($datefield, $day_date, $month_date, $year_date, $excludefirstand=0, $gm=false) | |
| Generate a SQL string to make a filter into a range (for second of date until last second of date). | |
| dol_stringtotime ($string, $gm=1) | |
| Convert a string date into a GM Timestamps date Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not supported. | |
| dol_get_prev_day ($day, $month, $year) | |
| Return previous day. | |
| dol_get_next_day ($day, $month, $year) | |
| Return next day. | |
| dol_get_prev_month ($month, $year) | |
| Return previous month. | |
| dol_get_next_month ($month, $year) | |
| Return next month. | |
| dol_get_prev_week ($day, $week, $month, $year) | |
| Return previous week. | |
| dol_get_next_week ($day, $week, $month, $year) | |
| Return next week. | |
| dol_get_first_day ($year, $month=1, $gm=false) | |
| Return GMT time for first day of a month or year. | |
| dol_get_last_day ($year, $month=12, $gm=false) | |
| Return GMT time for last day of a month or year. | |
| dol_get_last_hour ($date, $gm='tzserver') | |
| Return GMT time for last hour of a given GMT date (it replaces hours, min and second part to 23:59:59) | |
| dol_get_first_hour ($date, $gm='tzserver') | |
| Return GMT time for first hour of a given GMT date (it removes hours, min and second part) | |
| dol_get_first_day_week ($day, $month, $year, $gm=false) | |
| Return first day of week for a date. | |
| getGMTEasterDatetime ($year) | |
| Return the easter day in GMT time. | |
| num_public_holiday ($timestampStart, $timestampEnd, $countryCodeOrId='', $lastday=0, $includesaturday=-1, $includesunday=-1, $includefriday=-1, $includemonday=-1) | |
| Return the number of non working days including Friday, Saturday and Sunday (or not) between 2 dates in timestamp. | |
| listPublicHoliday ($timestampStart, $timestampEnd, $countryCodeOrId='', $lastday=0, $excludesaturday=-1, $excludesunday=-1, $excludefriday=-1, $excludemonday=-1) | |
| Return the list of public holidays including Friday, Saturday and Sunday (or not) between 2 dates in timestamp. | |
| num_between_day ($timestampStart, $timestampEnd, $lastday=0) | |
| Function to return number of days between two dates (date must be UTC date !) Example: 2012-01-01 2012-01-02 => 1 if lastday=0, 2 if lastday=1. | |
| num_open_day ($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0, $countryCodeOrId='', $user_id=0) | |
| Function to return number of working days (and text of units) between two dates (working days) | |
| monthArray ($outputlangs, $short=0) | |
| Return array of translated months or selected month. | |
| getWeekNumbersOfMonth ($month, $year) | |
| Return array of week numbers. | |
| getFirstDayOfEachWeek ($TWeek, $year) | |
| Return array of first day of weeks. | |
| getLastDayOfEachWeek ($TWeek, $year) | |
| Return array of last day of weeks. | |
| getWeekNumber ($day, $month, $year) | |
| Return week number. | |
Set of function to manipulate dates.
Definition in file date.lib.php.
| convertDurationtoHour | ( | $duration_value, | |
| $duration_unit ) |
Convert duration to hour.
| float | $duration_value | Duration value |
| string | $duration_unit | Duration unit |
Definition at line 342 of file date.lib.php.
Referenced by BOM\calculateCosts().
| convertSecondToTime | ( | $iSecond, | |
| $format = 'all', | |||
| $lengthOfDay = 86400, | |||
| $lengthOfWeek = 7 ) |
Return, in clear text, value of a number of seconds in days, hours and minutes.
Can be used to show a duration.
| int | $iSecond | Number of seconds |
| 'all'|'allwithouthour'|'allhourmin'|'allhourminsec'|'allhour'|'fullhour'|'hour'|'min'|'sec'|'month'|'year' | $format Output format
| |
| int<1,86400> | $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour) | |
| int<1,7> | $lengthOfWeek Length of week (default 7) |
Definition at line 248 of file date.lib.php.
References dol_print_date().
Referenced by build_calfile(), constructGanttLine(), doc_generic_project_odt\get_substitutionarray_tasks(), doc_generic_task_odt\get_substitutionarray_tasks(), doc_generic_project_odt\get_substitutionarray_taskstime(), doc_generic_task_odt\get_substitutionarray_taskstime(), getTaskProgressView(), print_projecttasks_array(), DurationField\printOutputField(), projectLinesPerAction(), projectLinesPerDay(), projectLinesPerWeek(), ExtraFields\showOutputField(), pdf_baleine\write_file(), pdf_soleil\write_file(), pdf_strato\write_file(), and pdf_timespent\write_file().
| convertTime2Seconds | ( | $iHours = 0, | |
| $iMinutes = 0, | |||
| $iSeconds = 0 ) |
Convert hours and minutes into seconds.
| int | $iHours | Hours |
| int | $iMinutes | Minutes |
| int | $iSeconds | Seconds |
Definition at line 219 of file date.lib.php.
| dol_get_first_day | ( | $year, | |
| $month = 1, | |||
| $gm = false ) |
Return GMT time for first day of a month or year.
| int | $year | Year |
| int | $month | Month |
| bool|int<0,1>|'gmt'|'tzserver'|'tzref'|'tzuser'|'tzuserrel' | $gm False or 0 or 'tzserver' = Return date to compare with server TZ, True or 1 or 'gmt' to compare with GMT date. Example: dol_get_first_day(1970,1,false) will return -3600 with TZ+1, a dol_print_date on it will return 1970-01-01 00:00:00 Example: dol_get_first_day(1970,1,true) will return 0 whatever is TZ, a dol_print_date on it will return 1970-01-01 00:00:00 |
Definition at line 604 of file date.lib.php.
References dol_mktime().
Referenced by pdf_standard_actions\_pages(), activitytrim(), ActionComm\build_exportfile(), ProjectStats\buildWhere(), TaskStats\buildWhere(), Asset\calculationDepreciation(), AdherentStats\countMembersByTagAndStatus(), AdherentStats\countMembersByTypeAndStatus(), Facture\createFromClone(), dolSqlDateFilter(), CommandeStats\getAllByProduct(), ContratStats\getAllByProduct(), FactureStats\getAllByProduct(), FichinterStats\getAllByProduct(), MyObjectStats\getAllByProduct(), PropaleStats\getAllByProduct(), CommandeStats\getAmountByMonth(), ContratStats\getAmountByMonth(), FactureStats\getAmountByMonth(), FichinterStats\getAmountByMonth(), MyObjectStats\getAmountByMonth(), PropaleStats\getAmountByMonth(), ReceptionStats\getAmountByMonth(), FactureStats\getAmountByYear(), CommandeStats\getAverageByMonth(), ContratStats\getAverageByMonth(), FactureStats\getAverageByMonth(), FichinterStats\getAverageByMonth(), MyObjectStats\getAverageByMonth(), ProjectStats\getAverageByMonth(), PropaleStats\getAverageByMonth(), ReceptionStats\getAverageByMonth(), TaskStats\getAverageByMonth(), CommandeStats\getNbByMonth(), ContratStats\getNbByMonth(), DonationStats\getNbByMonth(), ExpeditionStats\getNbByMonth(), FactureStats\getNbByMonth(), FichinterStats\getNbByMonth(), MyObjectStats\getNbByMonth(), PropaleStats\getNbByMonth(), ReceptionStats\getNbByMonth(), AccountancyCategory\getSumDebitCredit(), box_birthdays\loadBox(), Localtax\localtax_sum_collectee(), Localtax\localtax_sum_payee(), Localtax\localtax_sum_reglee(), Holiday\sendPreviousMonthHRInformations(), tax_by_rate(), tax_by_thirdparty(), pdf_paiement\write_file(), and pdf_standard_movementstock\write_file().
| dol_get_first_day_week | ( | $day, | |
| $month, | |||
| $year, | |||
| $gm = false ) |
Return first day of week for a date.
First day of week may be monday if option MAIN_START_WEEK is 1.
| int | $day | Day |
| int | $month | Month |
| int | $year | Year |
| bool|int<0,1>|'gmt'|'tzserver'|'tzref'|'tzuser'|'tzuserrel' | $gm False or 0 or 'tzserver' = Return date to compare with server TZ, True or 1 or 'gmt' to compare with GMT date. |
Definition at line 679 of file date.lib.php.
References date, dol_getdate(), dol_mktime(), and getDolGlobalInt().
Referenced by Project\createWeeklyReport(), dol_get_next_week(), and dol_get_prev_week().
| dol_get_first_hour | ( | $date, | |
| $gm = 'tzserver' ) |
Return GMT time for first hour of a given GMT date (it removes hours, min and second part)
| int | $date | Date GMT |
| bool | int | string | $gm | False or 0 or 'tzserver' = Return date to compare with server TZ, 'gmt' to compare with GMT date. |
Definition at line 664 of file date.lib.php.
References dol_getdate(), and dol_mktime().
Referenced by Societe\getOutstandingBills(), User\isNotIntoValidityDateRange(), Facture\sendEmailsRemindersOnInvoiceDueDate(), FactureFournisseur\sendEmailsRemindersOnSupplierInvoiceDueDate(), and DateField\sqlFilterSearchField().
| dol_get_last_day | ( | $year, | |
| $month = 12, | |||
| $gm = false ) |
Return GMT time for last day of a month or year.
Note: The timestamp contains last day and last hours (23:59:59)
| int | $year | Year |
| int | $month | Month |
| bool|int<0,1>|'gmt'|'tzserver'|'tzref'|'tzuser'|'tzuserrel' | $gm False or 0 or 'tzserver' = Return date to compare with server TZ, True or 1 or 'gmt' to compare with GMT date. |
Definition at line 623 of file date.lib.php.
References dol_mktime().
Referenced by pdf_standard_actions\_pages(), ActionComm\build_exportfile(), ProjectStats\buildWhere(), TaskStats\buildWhere(), Asset\calculationDepreciation(), Facture\createFromClone(), dolSqlDateFilter(), Accountancy\exportData(), CommandeStats\getAllByProduct(), ContratStats\getAllByProduct(), FactureStats\getAllByProduct(), FichinterStats\getAllByProduct(), MyObjectStats\getAllByProduct(), PropaleStats\getAllByProduct(), CommandeStats\getAmountByMonth(), ContratStats\getAmountByMonth(), FactureStats\getAmountByMonth(), FichinterStats\getAmountByMonth(), MyObjectStats\getAmountByMonth(), PropaleStats\getAmountByMonth(), ReceptionStats\getAmountByMonth(), FactureStats\getAmountByYear(), CommandeStats\getAverageByMonth(), ContratStats\getAverageByMonth(), FactureStats\getAverageByMonth(), FichinterStats\getAverageByMonth(), MyObjectStats\getAverageByMonth(), ProjectStats\getAverageByMonth(), PropaleStats\getAverageByMonth(), ReceptionStats\getAverageByMonth(), TaskStats\getAverageByMonth(), getCurrentPeriodOfFiscalYear(), getDefaultDatesForTransfer(), CommandeStats\getNbByMonth(), ContratStats\getNbByMonth(), DonationStats\getNbByMonth(), ExpeditionStats\getNbByMonth(), FactureStats\getNbByMonth(), FichinterStats\getNbByMonth(), MyObjectStats\getNbByMonth(), PropaleStats\getNbByMonth(), ReceptionStats\getNbByMonth(), AccountancyCategory\getSumDebitCredit(), Localtax\localtax_sum_collectee(), Localtax\localtax_sum_payee(), Localtax\localtax_sum_reglee(), Holiday\sendPreviousMonthHRInformations(), tax_by_rate(), tax_by_thirdparty(), pdf_paiement\write_file(), and pdf_standard_movementstock\write_file().
| dol_get_last_hour | ( | $date, | |
| $gm = 'tzserver' ) |
Return GMT time for last hour of a given GMT date (it replaces hours, min and second part to 23:59:59)
| int | $date | Date GMT |
| bool | int | string | $gm | False or 0 or 'tzserver' = Return date to compare with server TZ, 'gmt' to compare with GMT date. |
Definition at line 650 of file date.lib.php.
References dol_getdate(), and dol_mktime().
Referenced by Facture\createDepositFromOrigin(), getCurrentPeriodOfFiscalYear(), getDefaultDatesForTransfer(), User\isNotIntoValidityDateRange(), and BookKeeping\loadFiscalPeriods().
| dol_get_next_day | ( | $day, | |
| $month, | |||
| $year ) |
Return next day.
| int | $day | Day |
| int | $month | Month |
| int | $year | Year |
Definition at line 508 of file date.lib.php.
References dol_getdate(), and dol_mktime().
| dol_get_next_month | ( | $month, | |
| $year ) |
Return next month.
| int | $month | Month |
| int | $year | Year |
Definition at line 542 of file date.lib.php.
Referenced by Facture\createFromClone(), and Holiday\updateSoldeCP().
| dol_get_next_week | ( | $day, | |
| $week, | |||
| $month, | |||
| $year ) |
Return next week.
| int | $day | Day |
| int | $week | Week |
| int | $month | Month |
| int | $year | Year |
Definition at line 582 of file date.lib.php.
References dol_get_first_day_week(), dol_getdate(), and dol_mktime().
| dol_get_prev_day | ( | $day, | |
| $month, | |||
| $year ) |
Return previous day.
| int | $day | Day |
| int | $month | Month |
| int | $year | Year |
Definition at line 492 of file date.lib.php.
References dol_getdate(), and dol_mktime().
| dol_get_prev_month | ( | $month, | |
| $year ) |
Return previous month.
| int | $month | Month |
| int | $year | Year |
Definition at line 523 of file date.lib.php.
Referenced by Accountancy\exportData(), and Holiday\sendPreviousMonthHRInformations().
| dol_get_prev_week | ( | $day, | |
| $week, | |||
| $month, | |||
| $year ) |
Return previous week.
| int | $day | Day |
| int | $week | Week |
| int | $month | Month |
| int | $year | Year |
Definition at line 563 of file date.lib.php.
References dol_get_first_day_week(), dol_getdate(), and dol_mktime().
| dol_stringtotime | ( | $string, | |
| $gm = 1 ) |
Convert a string date into a GM Timestamps date Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not supported.
If parameter gm is 1, we will use no TZ, if not we will use TZ of server, not the one inside string.
| string | $string | Date in a string YYYYMMDD YYYYMMDDHHMMSS YYYYMMDDTHHMMSSZ YYYY-MM-DDTHH:MM:SSZ (RFC3339) DD/MM/YY or DD/MM/YYYY (deprecated) DD/MM/YY HH:MM:SS or DD/MM/YYYY HH:MM:SS (deprecated) |
| int<0,1>|'gmt'|'tzserver'|'tzref'|'tzuser'|'tzuserrel'|'dayrfc' | $gm 'gmt' or 1 =Input date is GM date, 'tzserver' or 0 =Input date is date using PHP server timezone |
Definition at line 435 of file date.lib.php.
References dol_mktime(), and dol_syslog().
Referenced by Invoices\addPayment(), Invoices\addPaymentDistributed(), Tasks\addTimeSpent(), ActionComm\build_exportfile(), ModeleImports\commonImportInsert(), createInvoice(), createOrder(), createProject(), ToolReports\getFinancialReport(), ExternalModules\getProducts(), ToolReports\getPurchaseReport(), ToolReports\getSalesReport(), ToolReports\getThirdpartyTransactions(), StockMovements\post(), Tasks\putTimeSpent(), Holiday\updateSoldeCP(), and ExportExcel2007\write_record().
| dol_time_plus_duree | ( | $time, | |
| $duration_value, | |||
| $duration_unit, | |||
| $ruleforendofmonth = 0 ) |
Add a delay to a date.
| int | $time | Date timestamp (Must be a UTC timestamp) |
| float | $duration_value | Value of delay to add |
| string | $duration_unit | Unit of added delay (d, m, y, w, h, mn|i) |
| int<0,1> | $ruleforendofmonth Change the behavior when $duration_unit = 'm' and new date reaches a non existing date. Use 0 (PHP behaviour) or 1 |
Definition at line 126 of file date.lib.php.
References dol_mktime(), dol_print_date(), and getDolGlobalString().
Referenced by modAdherent\__construct(), activitytrim(), Task\addTimeSpent(), ToolProducts\analyze(), build_calfile(), CommonInvoice\calculate_date_lim_reglement(), Asset\calculationDepreciation(), check_user_password_dolibarr(), checkNbPostsForASpeceificIp(), Facture\create(), FactureFournisseur\create(), Project\createWeeklyReport(), Task\delTimeSpent(), Contrat\doAutoRenewContracts(), PartnershipUtils\doCancelStatusOfMemberPartnership(), dol_setcache(), Accountancy\exportData(), FactureFournisseurRec\getNextDate(), FactureRec\getNextDate(), Adherent\initAsSpecimen(), listPublicHoliday(), box_activity\loadBox(), box_graph_nb_ticket_last_x_days\loadBox(), Project\loadTimeSpent(), Project\loadTimeSpentMonth(), num_public_holiday(), projectLinesPerDay(), projectLinesPerWeek(), Cronjob\reprogram_jobs(), Facture\sendEmailsRemindersOnInvoiceDueDate(), FactureFournisseur\sendEmailsRemindersOnSupplierInvoiceDueDate(), sendMail(), Adherent\sendReminderForExpiredSubscription(), Adherent\subscription(), Task\updateTimeSpent(), and pdf_bookkeeping\write_file().
| dolSqlDateFilter | ( | $datefield, | |
| $day_date, | |||
| $month_date, | |||
| $year_date, | |||
| $excludefirstand = 0, | |||
| $gm = false ) |
Generate a SQL string to make a filter into a range (for second of date until last second of date).
This method allows to maje SQL request that will deal correctly the timezone of server.
| string | $datefield | Name of SQL field where apply sql date filter |
| int | string | $day_date | Day date (Can be 0 or '' for filter on a month) |
| int | string | $month_date | Month date (Can be 0 or '' for filter on a year) |
| int | string | $year_date | Year date |
| int | $excludefirstand | Exclude first and |
| bool|int<0,1>|'gmt'|'tzserver'|'tzref'|'tzuser'|'tzuserrel' | $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ. Note: In database, dates are always for the server TZ. |
Definition at line 386 of file date.lib.php.
References $db, dol_get_first_day(), dol_get_last_day(), and dol_mktime().
Referenced by BookKeeping\deleteByYearAndJournal(), box_birthdays\loadBox(), and box_birthdays_members\loadBox().
| get_tz_array | ( | ) |
Return an array with timezone values.
Definition at line 37 of file date.lib.php.
| getFirstDayOfEachWeek | ( | $TWeek, | |
| $year ) |
Return array of first day of weeks.
| string[] | $TWeek | array of week numbers we want (week 1 must be '01') |
| int | $year | Year number |
Definition at line 1494 of file date.lib.php.
References date.
| getGMTEasterDatetime | ( | $year | ) |
Return the easter day in GMT time.
This function replaces easter_date() that returns a date in local TZ.
| int | $year | Year |
Definition at line 747 of file date.lib.php.
Referenced by listPublicHoliday(), and num_public_holiday().
| getLastDayOfEachWeek | ( | $TWeek, | |
| $year ) |
Return array of last day of weeks.
| string[] | $TWeek | array of week numbers |
| int | $year | Year number |
Definition at line 1513 of file date.lib.php.
References date.
| getServerTimeZoneInt | ( | $refgmtdate = 'now' | ) |
Return server timezone int.
| string | $refgmtdate | Reference period for timezone (timezone differs on winter and summer. May be 'now', 'winter' or 'summer') |
Definition at line 87 of file date.lib.php.
References dol_now(), dol_print_date(), dol_print_error(), and getServerTimeZoneString().
Referenced by dol_print_object_info(), and Form\selectDate().
| getServerTimeZoneString | ( | ) |
Return server timezone string.
Definition at line 76 of file date.lib.php.
Referenced by getServerTimeZoneInt().
| getWeekNumber | ( | $day, | |
| $month, | |||
| $year ) |
Return week number.
| int | $day | Day number |
| int | $month | Month number |
| int | $year | Year number |
Definition at line 1530 of file date.lib.php.
Referenced by getWeekNumbersOfMonth(), and Project\loadTimeSpentMonth().
| getWeekNumbersOfMonth | ( | $month, | |
| $year ) |
Return array of week numbers.
| int | $month | Month number |
| int | $year | Year number |
Definition at line 1476 of file date.lib.php.
References getWeekNumber().
| listPublicHoliday | ( | $timestampStart, | |
| $timestampEnd, | |||
| $countryCodeOrId = '', | |||
| $lastday = 0, | |||
| $excludesaturday = -1, | |||
| $excludesunday = -1, | |||
| $excludefriday = -1, | |||
| $excludemonday = -1 ) |
Return the list of public holidays including Friday, Saturday and Sunday (or not) between 2 dates in timestamp.
Dates must be UTC with hour, min, sec to 0. TODO Not used yet. Must be shared with num_public_holiday()
| int | $timestampStart | Timestamp start (UTC with hour, min, sec = 0) |
| int | $timestampEnd | Timestamp end (UTC with hour, min, sec = 0) |
| string | int | $countryCodeOrId | Country code or ID |
| int | $lastday | Last day is included, 0: no, 1:yes |
| int | $excludesaturday | Exclude saturday as non working day (-1=use setup, 0=no, 1=yes) |
| int | $excludesunday | Exclude sunday as non working day (-1=use setup, 0=no, 1=yes) |
| int | $excludefriday | Exclude friday as non working day (-1=use setup, 0=no, 1=yes) |
| int | $excludemonday | Exclude monday as non working day (-1=use setup, 0=no, 1=yes) |
Definition at line 1036 of file date.lib.php.
References $conf, $db, $mysoc, date, dol_getIdFromCode(), dol_syslog(), dol_time_plus_duree(), getDolGlobalInt(), getEntity(), and getGMTEasterDatetime().
| monthArray | ( | $outputlangs, | |
| $short = 0 ) |
Return array of translated months or selected month.
This replace old function monthArrayOrSelected.
| Translate | $outputlangs | Object langs |
| int | $short | 0=Return long label, 1=Return short label |
Definition at line 1432 of file date.lib.php.
| num_between_day | ( | $timestampStart, | |
| $timestampEnd, | |||
| $lastday = 0 ) |
Function to return number of days between two dates (date must be UTC date !) Example: 2012-01-01 2012-01-02 => 1 if lastday=0, 2 if lastday=1.
| int | $timestampStart | Timestamp start UTC |
| int | $timestampEnd | Timestamp end UTC |
| int | $lastday | Last day is included, 0: no, 1:yes |
Definition at line 1302 of file date.lib.php.
Referenced by Asset\calculationDepreciation(), and num_open_day().
| num_open_day | ( | $timestampStart, | |
| $timestampEnd, | |||
| $inhour = 0, | |||
| $lastday = 0, | |||
| $halfday = 0, | |||
| $countryCodeOrId = '', | |||
| $user_id = 0 ) |
Function to return number of working days (and text of units) between two dates (working days)
| int | $timestampStart | Timestamp for start date (date must be UTC to avoid calculation errors) |
| int | $timestampEnd | Timestamp for end date (date must be UTC to avoid calculation errors) |
| int | $inhour | 0: return number of days, 1: return number of hours |
| int | $lastday | We include last day, 0: no, 1:yes |
| int | $halfday | Tag to define half day when holiday start and end |
| string | int | $countryCodeOrId | Country Code or Id (company country code if not defined) |
| int | $user_id | User id. When > 0, the 'numOpenDay' hook fires after the standard calculation so modules can adjust the result for that user (e.g. employees with fewer than 5 fixed working days, bridge days, fixed half-days). Default 0 keeps the standard behavior unchanged. |
Definition at line 1334 of file date.lib.php.
References $mysoc, date, dol_syslog(), num_between_day(), and num_public_holiday().
Referenced by Holiday\approve(), sendMail(), Holiday\sendPreviousMonthHRInformations(), Holiday\update(), Holiday\updateSoldeCP(), and Holiday\validate().
| num_public_holiday | ( | $timestampStart, | |
| $timestampEnd, | |||
| $countryCodeOrId = '', | |||
| $lastday = 0, | |||
| $includesaturday = -1, | |||
| $includesunday = -1, | |||
| $includefriday = -1, | |||
| $includemonday = -1 ) |
Return the number of non working days including Friday, Saturday and Sunday (or not) between 2 dates in timestamp.
Dates must be UTC with hour, min, sec to 0. Called by function num_open_day()
| int | $timestampStart | Timestamp start (UTC with hour, min, sec = 0) |
| int | $timestampEnd | Timestamp end (UTC with hour, min, sec = 0) |
| string | int | $countryCodeOrId | Country code or ID |
| int | $lastday | Last day is included, 0: no, 1:yes |
| int | $includesaturday | Include saturday as non working day (-1=use setup, 0=no, 1=yes) |
| int | $includesunday | Include sunday as non working day (-1=use setup, 0=no, 1=yes) |
| int | $includefriday | Include friday as non working day (-1=use setup, 0=no, 1=yes) |
| int | $includemonday | Include monday as non working day (-1=use setup, 0=no, 1=yes) |
Definition at line 771 of file date.lib.php.
References $conf, $db, $mysoc, date, dol_getIdFromCode(), dol_syslog(), dol_time_plus_duree(), getDolGlobalInt(), and getGMTEasterDatetime().
Referenced by Project\createWeeklyReport(), and num_open_day().