Solved

date in fputcsv

Posted on 2010-08-31
3
1,135 Views
Last Modified: 2012-05-10
fputcsv($fpr,array(date ( 'm-j',$p['dateordered']),date ( 'm-j',$p['returndate'])
));

date is
2010-08-10 15:33:39.000

i am getting
1-Jan

I want
10-Aug
0
Comment
Question by:rgb192
3 Comments
 
LVL 13

Accepted Solution

by:
marchent earned 250 total points
ID: 33570276
replace
date ( 'm-j',$p['dateordered'])


with
date('j-M', strtotime($p['dateordered']) )
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 33571231
When you need to handle date / time fields in PHP and MySQL, this reference may be useful to you.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201.html
0
 

Author Closing Comment

by:rgb192
ID: 33612688
thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now