_dateToDays

The WooCommerce Boleto dateToDays function.

Description

_dateToDays( $year, $month, $day ); 

Parameters (3)

0. $year
The year.
1. $month
The month.
2. $day
The day.

Usage

  1. if ( !function_exists( '_dateToDays' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-boleto/includes/banks/bancoob/functions.php'; 
  3.  
  4. // The year. 
  5. $year = null; 
  6.  
  7. // The month. 
  8. $month = null; 
  9.  
  10. // The day. 
  11. $day = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = _dateToDays($year, $month, $day); 
  15.  

Defined (12)

The function is defined in the following location(s).

/includes/banks/bancoob/functions.php  
  1. function _dateToDays($year, $month, $day) { 
  2. $century = substr($year, 0, 2); 
  3. $year = substr($year, 2, 2); 
  4. if ($month > 2) { 
  5. $month -= 3; 
  6. } else { 
  7. $month += 9; 
  8. if ($year) { 
  9. $year--; 
  10. } else { 
  11. $year = 99; 
  12. $century --; 
  13. return ( floor(( 146097 * $century) / 4 ) + 
  14. floor(( 1461 * $year) / 4 ) + 
  15. floor(( 153 * $month + 2) / 5 ) + 
  16. $day + 1721119); 
/includes/banks/bb/functions.php  
  1. function _dateToDays( $year, $month, $day ) { 
  2. $century = substr( $year, 0, 2 ); 
  3. $year = substr( $year, 2, 2 ); 
  4. if ( $month > 2 ) { 
  5. $month -= 3; 
  6. } else { 
  7. $month += 9; 
  8. if ( $year ) { 
  9. $year--; 
  10. } else { 
  11. $year = 99; 
  12. $century --; 
  13.  
  14. return ( floor( ( 146097 * $century ) / 4 ) + 
  15. floor( ( 1461 * $year ) / 4 ) + 
  16. floor( ( 153 * $month + 2 ) / 5 ) + 
  17. $day + 1721119 ); 
/includes/banks/bradesco/functions.php  
  1. function _dateToDays( $year, $month, $day ) { 
  2. $century = substr( $year, 0, 2 ); 
  3. $year = substr( $year, 2, 2 ); 
  4. if ( $month > 2 ) { 
  5. $month -= 3; 
  6. } else { 
  7. $month += 9; 
  8. if ( $year ) { 
  9. $year--; 
  10. } else { 
  11. $year = 99; 
  12. $century --; 
  13. return ( floor( ( 146097 * $century ) / 4 ) + 
  14. floor( ( 1461 * $year ) / 4 ) + 
  15. floor( ( 153 * $month + 2 ) / 5 ) + 
  16. $day + 1721119 ); 
/includes/banks/cef/functions.php  
  1. function _dateToDays( $year, $month, $day ) { 
  2. $century = substr( $year, 0, 2 ); 
  3. $year = substr( $year, 2, 2 ); 
  4. if ( $month > 2 ) { 
  5. $month -= 3; 
  6. } else { 
  7. $month += 9; 
  8. if ( $year ) { 
  9. $year--; 
  10. } else { 
  11. $year = 99; 
  12. $century --; 
  13. return ( floor( ( 146097 * $century ) / 4 ) + 
  14. floor( ( 1461 * $year ) / 4 ) + 
  15. floor( ( 153 * $month + 2 ) / 5 ) + 
  16. $day + 1721119 ); 
/includes/banks/cef_sigcb/functions.php  
  1. function _dateToDays( $year, $month, $day ) { 
  2. $century = substr( $year, 0, 2 ); 
  3. $year = substr( $year, 2, 2 ); 
  4. if ( $month > 2 ) { 
  5. $month -= 3; 
  6. } else { 
  7. $month += 9; 
  8. if ( $year ) { 
  9. $year--; 
  10. } else { 
  11. $year = 99; 
  12. $century --; 
  13. return ( floor( ( 146097 * $century ) / 4 ) + 
  14. floor( ( 1461 * $year ) / 4 ) + 
  15. floor( ( 153 * $month + 2 ) / 5 ) + 
  16. $day + 1721119 ); 
/includes/banks/cef_sinco/functions.php  
  1. function _dateToDays( $year, $month, $day ) { 
  2. $century = substr( $year, 0, 2 ); 
  3. $year = substr( $year, 2, 2 ); 
  4. if ( $month > 2 ) { 
  5. $month -= 3; 
  6. } else { 
  7. $month += 9; 
  8. if ( $year ) { 
  9. $year--; 
  10. } else { 
  11. $year = 99; 
  12. $century --; 
  13. return ( floor( ( 146097 * $century ) / 4 ) + 
  14. floor( ( 1461 * $year ) / 4 ) + 
  15. floor( ( 153 * $month + 2 ) / 5 ) + 
  16. $day + 1721119 ); 
/includes/banks/hsbc/functions.php  
  1. function _dateToDays( $year, $month, $day ) { 
  2. $century = substr( $year, 0, 2 ); 
  3. $year = substr( $year, 2, 2 ); 
  4. if ( $month > 2 ) { 
  5. $month -= 3; 
  6. } else { 
  7. $month += 9; 
  8. if ( $year ) { 
  9. $year--; 
  10. } else { 
  11. $year = 99; 
  12. $century --; 
  13. return ( floor( ( 146097 * $century ) / 4 ) + 
  14. floor( ( 1461 * $year ) / 4 ) + 
  15. floor( ( 153 * $month + 2 ) / 5 ) + 
  16. $day + 1721119 ); 
/includes/banks/itau/functions.php  
  1. function _dateToDays( $year, $month, $day ) { 
  2. $century = substr( $year, 0, 2 ); 
  3. $year = substr( $year, 2, 2 ); 
  4. if ( $month > 2 ) { 
  5. $month -= 3; 
  6. } else { 
  7. $month += 9; 
  8. if ( $year ) { 
  9. $year--; 
  10. } else { 
  11. $year = 99; 
  12. $century --; 
  13. return ( floor( ( 146097 * $century ) / 4 ) + 
  14. floor( ( 1461 * $year ) / 4 ) + 
  15. floor( ( 153 * $month + 2 ) / 5 ) + 
  16. $day + 1721119 ); 
/includes/banks/nossacaixa/functions.php  
  1. function _dateToDays( $year, $month, $day ) { 
  2. $century = substr( $year, 0, 2 ); 
  3. $year = substr( $year, 2, 2 ); 
  4. if ( $month > 2 ) { 
  5. $month -= 3; 
  6. } else { 
  7. $month += 9; 
  8. if ( $year ) { 
  9. $year--; 
  10. } else { 
  11. $year = 99; 
  12. $century --; 
  13. return ( floor( ( 146097 * $century ) / 4 ) + 
  14. floor( ( 1461 * $year ) / 4 ) + 
  15. floor( ( 153 * $month + 2 ) / 5 ) + 
  16. $day + 1721119 ); 
/includes/banks/real/functions.php  
  1. function _dateToDays( $year, $month, $day ) { 
  2. $century = substr( $year, 0, 2 ); 
  3. $year = substr( $year, 2, 2 ); 
  4. if ( $month > 2 ) { 
  5. $month -= 3; 
  6. } else { 
  7. $month += 9; 
  8. if ( $year ) { 
  9. $year--; 
  10. } else { 
  11. $year = 99; 
  12. $century --; 
  13. return ( floor( ( 146097 * $century ) / 4 ) + 
  14. floor( ( 1461 * $year ) / 4 ) + 
  15. floor( ( 153 * $month + 2 ) / 5 ) + 
  16. $day + 1721119 ); 
/includes/banks/santander/functions.php  
  1. function _dateToDays( $year, $month, $day ) { 
  2. $century = substr( $year, 0, 2 ); 
  3. $year = substr( $year, 2, 2 ); 
  4. if ( $month > 2 ) { 
  5. $month -= 3; 
  6. } else { 
  7. $month += 9; 
  8. if ( $year ) { 
  9. $year--; 
  10. } else { 
  11. $year = 99; 
  12. $century --; 
  13. return ( floor( ( 146097 * $century ) / 4 ) + 
  14. floor( ( 1461 * $year ) / 4 ) + 
  15. floor( ( 153 * $month + 2 ) / 5 ) + 
  16. $day + 1721119 ); 
/includes/banks/unibanco/functions.php  
  1. function _dateToDays( $year, $month, $day ) { 
  2. $century = substr( $year, 0, 2 ); 
  3. $year = substr( $year, 2, 2 ); 
  4. if ( $month > 2 ) { 
  5. $month -= 3; 
  6. } else { 
  7. $month += 9; 
  8. if ( $year ) { 
  9. $year--; 
  10. } else { 
  11. $year = 99; 
  12. $century --; 
  13. return ( floor( ( 146097 * $century ) / 4 ) + 
  14. floor( ( 1461 * $year ) / 4 ) + 
  15. floor( ( 153 * $month + 2 ) / 5 ) + 
  16. $day + 1721119 );