Re: how to split the stirng(02-02-2009 13:24:27)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Malayappa,

Use the following way:

list($m, $d, $y, $h, $i, $s) = sscanf('01-31-2009 13:24:27', "%2d-%2d-%4d %2d:%2d:%2d");

echo sprintf("%2d%-2d%-4d %2d:%2d", $d, $m, $y, $h, $i);

Repost if you get any issue.

 Thanks & Regards
Udayakumar Sarangapani
Sr. PHP Developer
CompIndia Infotech Pvt. Ltd.
Chennai.

"Science is nothing but logic..."





________________________________
From: malayappa2000 <malayappa@xxxxxxxxxxxxxxxxxx>
To: php-objects@xxxxxxxxxxxxxxx
Sent: Monday, 2 February, 2009 5:31:24 PM
Subject:  how to split the stirng(02-02-2009 13:24:27)


hi guys

we are the fallowing sting

01-31-2009 13:24:27
we need to split sec in the above stirng i.e we need out put in the
fallowing formta

01-31-2009 13:24 

provide some help ho to achive this.


    


      Connect with friends all over the world. Get Yahoo! India Messenger at http://in.messenger.yahoo.com/?wm=n/

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux