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.
awarraicAsked:
Who is Participating?
 
mankowitzConnect With a Mentor Commented:
but i did answer.
0
 
mankowitzCommented:
use date("Ymd\THis", $start_date)
0
 
mankowitzCommented:
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));

0
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:
19700101T000003

Do I need to set some default date format or something?
Thanks.
0
 
awarraicAuthor Commented:
It worked, just missed strtotime(). thanks much.
0
 
awarraicAuthor Commented:
Sorry somehow the points thing didn't work.
0
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.