Solved

date in fputcsv

Posted on 2010-08-31
3
1,120 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
Comment Utility
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
Comment Utility
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
Comment Utility
thanks
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

772 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

10 Experts available now in Live!

Get 1:1 Help Now