Skip to content

Commit

Permalink
Merge pull request #24 from arquivei/feature/engaja-131-v5
Browse files Browse the repository at this point in the history
Altera método toTimestamp da classe /src/legacy/Common.php
  • Loading branch information
lucasm-moreira authored Feb 15, 2022
2 parents e8a49cb + ce8e255 commit cceff8e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Legacy/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ protected function ymdTodmy($data = '')
*/
public function toTimestamp($input)
{
/*$regex = '^(2[0-9][0-9][0-9])[-](0?[1-9]'
$regex = '^(2[0-9][0-9][0-9])[-](0?[1-9]'
. '|1[0-2])[-](0?[1-9]'
. '|[12][0-9]'
. '|3[01])T([0-9]|0[0-9]'
. '|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]-(00|01|02|03|04):00$';
. '|3[01])T(0[0-9]'
. '|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9][-|+](00|01|02|03|04|05|06|07|08|09|10|11|12):00$';

if (!preg_match("/$regex/", $input)) {
return '';
}*/
return 0;
}
return \DateTime::createFromFormat("Y-m-d\TH:i:sP", $input)->getTimestamp();
}

Expand Down

0 comments on commit cceff8e

Please sign in to comment.