List Info

Thread: note 72739 added to function.strtotime




note 72739 added to function.strtotime
user name
2007-01-31 03:23:20
TRstrtotime -- Parse about any Turkish formatted datetime
description into a Unix timestamp
function ($date){
    if(($date=strptime($date,"%d-%m-%Y
%H:%M:%S"))===false)
        return false;
    return mktime($date['tm_hour'], $date['tm_min'],
$date['tm_sec'], $date['tm_mon']+1, $date['tm_mday'],
$date['tm_year']+1900);
}

strptime counts months from 0, where january is first, and
of course ends with 11 where december is 12th month. Also
(it is neglegable) year is years since 1900, thus we add
this part.
I wish we could use format in strtotime, it would make life
much easier.
----
Server IP: 139.179.10.17
Probable Submitter: 195.175.46.10
----
Manual Page -- h
ttp://www.php.net/manual/en/function.strtotime.php
Edit        -- https://master
.php.net/note/edit/72739
Del: integrated  -- h
ttps://master.php.net/note/delete/72739/integrated
Del: useless     -- http
s://master.php.net/note/delete/72739/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/72739/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/72739/spam
Del: non-english -- 
https://master.php.net/note/delete/72739/non-english
Del: in docs     -- http
s://master.php.net/note/delete/72739/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/72739
Reject      -- https://mast
er.php.net/note/reject/72739
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


note 72739 deleted from function.strtotime by nlopess
user name
2007-01-31 07:25:39
Note Submitter: erkintek at fotograf dot web dot tr 

----

TRstrtotime -- Parse about any Turkish formatted datetime
description into a Unix timestamp
function ($date){
    if(($date=strptime($date,"%d-%m-%Y
%H:%M:%S"))===false)
        return false;
    return mktime($date['tm_hour'], $date['tm_min'],
$date['tm_sec'], $date['tm_mon']+1, $date['tm_mday'],
$date['tm_year']+1900);
}

strptime counts months from 0, where january is first, and
of course ends with 11 where december is 12th month. Also
(it is neglegable) year is years since 1900, thus we add
this part.
I wish we could use format in strtotime, it would make life
much easier.

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )