|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-07-01 03:11 UTC] aharvey@php.net
-Status: Open
+Status: Wont fix
[2011-07-01 03:11 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 18:00:01 2025 UTC |
Description: ------------ It would be awesome to have a function in the standard library which either one working like strptime() but returning a UNIX timestamp or one converting an array like those returned by strptime() into a UNIX timestamp. Test script: --------------- <?php function strptime_array_to_timestamp($array) { if(!empty($array['unparsed'])) { return false; } return mktime( isset($array['tm_hour']) ? $array['tm_hour'] : null, isset($array['tm_min']) ? $array['tm_min'] : null, isset($array['tm_sec']) ? $array['tm_sec'] : null, isset($array['tm_mon']) ? 1+$array['tm_mon'] : null, isset($array['tm_mday']) ? $array['tm_mday'] : null, isset($array['tm_year']) ? 1900+$array['tm_year'] : null); }