To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Upgrading PHP

Upgrading PHP Issues concerning PHP version upgrades and future releases

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-18-2004, 04:32 PM   #1
Pigmaster
Moonbase Alpha Pilot
 
Join Date: Sep 2002
Posts: 63
Problem with date function

I have the following in part of my scripts...


$EventDate="19/09/2004";
echo "EventDateFromDB ".$EventDate."<br>";
$EventDate1 = date ("d/M/y",$EventDate);
echo "EventDateFromEventDateInDB ".$EventDate1."<br>";


$EventDate returns 19/09/2004
and EventDate1 should return 19/Sep/2004

It worked fine in php4.x.x but I have upgraded to php5 and it fails.

Any ideas?

ps.
$EventDate actually comes from a datebase call to a record date, but I have given it a static value of 19/09/2004 just for this posting.
Pigmaster is offline   Reply With Quote
Old 08-18-2004, 04:50 PM   #2
ZibingsCoder
Kerflaffles, eh?
 
Join Date: May 2003
Location: Pennsylvania, USA
Posts: 409
You might consider switching your system to use UNIX timestamps. Would make things like this non-existant.
__________________
Use the PHP tags when posting PHP.
Mark all issues as resolved once your question is answered.

http://amale.zibings.com/
N2 Framework Yverdon (Alpha)
ZibingsCoder is offline   Reply With Quote
Old 08-18-2004, 04:56 PM   #3
Shrike
Not Yet Involved
 
Shrike's Avatar
 
Join Date: Oct 2003
Location: The Eighth, Sursamen
Posts: 2,254
date() has always required a timestamp for the 2nd parameter.
PHP Code:
date("Y/m/d", strtotime("2004-01-01"));
__________________
The Hundredth Idiot
Shrike is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 01:10 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.