PHP date time formating

How do I format date/time to 20110224T090000 format?
I looked up PHP date functions but most of the examples were for current date only.

Let's see I have a variable $start_date

The date that I have in Oracle database is: 4/14/2011 10:00:00 AM

How do I format this in PHP that it gives me 20110414T100000

Thanks much.
Who is Participating?
mankowitzConnect With a Mentor Commented:
but i did answer.
use date("Ymd\THis", $start_date)
note that the date function assumes $start_date is in timestamp format. You can do that via oracle, or you can parse it with

echo date("Ymd\THis", strtotime($start_date));

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

awarraicAuthor Commented:
it shows some default date:

Do I need to set some default date format or something?
awarraicAuthor Commented:
It worked, just missed strtotime(). thanks much.
awarraicAuthor Commented:
Sorry somehow the points thing didn't work.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.