RE: [PHP] How to convert '2001032018' - '2001 03 20 18' ? (Fomating Date)

2001-03-20 Thread Altunergil, Oktay


function sql_to_unix_time($timeString)
{
return mktime(substr($timeString, 8,2), substr($timeString,
10,2), substr($timeString, 12,2),
substr($timeString, 4,2), substr($timeString, 6,2),
substr($timeString, 0,4));
}


you can use the above function to convert your mysql time stamp to a unix
timestamp (how long ago was the epoch? ) and use php time related functions
(such as time() )to manipulate it however you want.
PS: The function is not mine.



-Original Message-
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 1:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to convert '2001032018' - '2001 03 20 18' ?
(Fomating Date)


Hi,

I'm trying to convert the timestamp '2001032018' into '2001 03 20 18' or an
Array which I can easily format. Do you remember any date or string function
I can use?

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

--
Phone:   (+354) 4615501
Mobile:  (+354) 8960376
Fax: (+354) 4615503
E-mail:  [EMAIL PROTECTED]
Homepage:www.sed.is - New Homepage!
--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to convert '2001032018' - '2001 03 20 18' ? (Fomating Date)

2001-03-20 Thread Hoover, Josh

You could try this:

function convertTimeStamp($yourTimeStamp)
{
$strTime[0] = substr($yourTimeStamp, 0,4);
$strTime[1] = substr($yourTimeStamp, 4,2);
$strTime[2] = substr($yourTimeStamp, 6,2);
$strTime[3] = substr($yourTimeStamp, 8,2);

return $strTime;
}

Josh Hoover
KnowledgeStorm, Inc.
[EMAIL PROTECTED]

Searching for a new IT solution for your company? Need to improve your
product marketing? 
Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify
the process for you.
KnowledgeStorm - Your IT Search Starts Here 

 I'm trying to convert the timestamp '2001032018' into '2001 
 03 20 18' or an
 Array which I can easily format. Do you remember any date or 
 string function
 I can use?