dataJuliano

The WooCommerce Boleto dataJuliano function.

Description

dataJuliano( $data ); 

Parameters (1)

0. $data
The data.

Usage

  1. if ( !function_exists( 'dataJuliano' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-boleto/includes/banks/hsbc/functions.php'; 
  3.  
  4. // The data. 
  5. $data = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = dataJuliano($data); 
  9.  

Defined (2)

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

/includes/banks/hsbc/functions.php  
  1. function dataJuliano( $data ) { 
  2. $dia = (int)substr( $data, 0, 2 ); 
  3. $mes = (int)substr( $data, 3, 2 ); 
  4. $ano = (int)substr( $data, 6, 4 ); 
  5. $dataf = strtotime( "$ano/$mes/$dia" ); 
  6. $datai = strtotime( ( $ano-1 ).'/12/31' ); 
  7. $dias = (int)( ( $dataf - $datai )/( 60*60*24 ) ); 
  8. return str_pad( $dias, 3, '0', STR_PAD_LEFT ).substr( $data, 9, 4 ); 
/includes/banks/santander/functions.php  
  1. function dataJuliano( $data ) { 
  2. $dia = (int)substr( $data, 1, 2 ); 
  3. $mes = (int)substr( $data, 3, 2 ); 
  4. $ano = (int)substr( $data, 6, 4 ); 
  5. $dataf = strtotime( "$ano/$mes/$dia" ); 
  6. $datai = strtotime( ( $ano-1 ).'/12/31' ); 
  7. $dias = (int)( ( $dataf - $datai )/( 60*60*24 ) ); 
  8. return str_pad( $dias, 3, '0', STR_PAD_LEFT ).substr( $data, 9, 4 );