-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: MySQL's STR_TO_DATE function implementation #56
base: master
Are you sure you want to change the base?
Conversation
$format = Evaluator::evaluate($conn, $scope, $args[1], $row, $result); | ||
|
||
if (strpos($format, '%') === false) { | ||
return $format; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
$date_format_list = [ | ||
"%c" => "n", "%D" => "jS", "%d" => "d", "%e" => "j", | ||
"%M" => "F", "%b" => "M", "%m" => "m" ,"%Y" => "Y", "%y" => "y" | ||
]; | ||
|
||
$time_format_list = [ | ||
"%k" => "G", "%l" => "g", "%S" => "s", "%s" => "s", "%T" => "H:i:s", | ||
"%r" => "h:i:s A", "%H" => "H", "%h" => "h", "%i" => "i", | ||
]; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
]; | ||
|
||
$is_in_date_format = false; | ||
$is_in_time_format = false; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
foreach ($matches[0] as $match) { | ||
$is_in_date_format = in_array($match, array_keys($date_format_list)); | ||
$is_in_time_format = in_array($match, array_keys($time_format_list)); | ||
} |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
d972da8
to
c637a08
Compare
@aaronm67 |
It looks like I can't grant you access to run workflows, but I can run them for you. You can see results here - https://github.com/vimeo/php-mysql-engine/actions/runs/14122732372/job/39592916472?pr=56 |
0936aa8
to
d9795ac
Compare
* Update phpunit.yml * use actions/cache@v4
@aaronm67 |
The STR_TO_DATE function in MySQL was not implemented, so it was added.
By specifying a string representing a date and the format of the string as an argument, it can be converted to a DATETIME type in a format such as
%Y-%m-%d %H:%i:%s
.