|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-04-20 05:46 UTC] shade at nekto dot com
[2008-10-28 22:28 UTC] jani@php.net
[2008-10-28 22:28 UTC] jani@php.net
[2008-11-05 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 20 15:00:01 2025 UTC |
Description: ------------ I am trying to insert 14:27 value in the datetime field. I think its correct, cause in PostgreSQL manual descripted following time inputs: Table 8.11. Time Input Example | Description 04:05 | ISO 8601 040506 | ISO 8601 .... cutted here.... 04:05:06 PST | time zone specified by name 2003-04-12 04:05:06 America/New_York | time zone specified by full name Only 2003-04-12 04:05:06 matches by time regexp in pg_convert. Here the reported regexp: '^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\.[0-9]+){0,1}([ \t]*([+-][0-9]{1,2}(:[0-9]{1,2}){0,1}|[a-zA-Z]{1,5})){0,1})){0,1}$' Its realizes logic 'date and maybe time', but it's not only possible input. Also i confised by [ \t]+ , united with XX:XX part of regexp. I think that regexp must be like that: '^(([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2}){0,1}([ \t]+){0,1}(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\.[0-9]+){0,1}([ \t]*([+-][0-9]{1,2}(:[0-9]{1,2}){0,1}|[a-zA-Z]{1,5})){0,1})){0,1}$' Expected result: ---------------- Inserted value in database table Actual result: -------------- Notice: pg_insert() [function.pg-insert]: '15:04' does not match with '^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\.[0-9]+){0,1}([ \t]*([+-][0-9]{1,2}(:[0-9]{1,2}){0,1}|[a-zA-Z]{1,5})){0,1})){0,1}$' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\data\index.php on line 226