Skip to content

Commit

Permalink
No commit do Sr. Giovani Paseto foi comentado o conteudo da funcao 't…
Browse files Browse the repository at this point in the history
…oTimestamp'.

Foi revertido essa alteração, pois não formata mais as datas.
  • Loading branch information
icompsoftcleiton committed Apr 30, 2024
1 parent 42f1702 commit 0813cad
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Legacy/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ protected function ymdTodmy($data = '')
*/
public function toTimestamp($input)
{
// $regex = '^(2[0-9][0-9][0-9])[-](0?[1-9]'
// . '|1[0-2])[-](0?[1-9]'
// . '|[12][0-9]'
// . '|3[01])T(0[0-9]'
// . '|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]-(01|02|03|04|05):00$';
//
// if (!preg_match("/$regex/", $input)) {
// return 0;
// }
// return \DateTime::createFromFormat("Y-m-d\TH:i:sP", $input)->getTimestamp();
$regex = '^(2[0-9][0-9][0-9])[-](0?[1-9]'
. '|1[0-2])[-](0?[1-9]'
. '|[12][0-9]'
. '|3[01])T(0[0-9]'
. '|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]-(01|02|03|04|05):00$';

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

/**
Expand Down

0 comments on commit 0813cad

Please sign in to comment.