CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 CCFormatDate

Print topic Send  topic

Author Message
marcos
Posted: 12/19/2005, 6:00 PM

I think this should be easy,..... but Im lost

I have a url param (datez) in this format: dd-mm-yyyy

I need to convert it to: yyyy/mm/dd to use it in a "Where" sentence, I tryed this approuch:

$str_1 = CCGetParam("datez"," ");
$str_2 = CCFormatDate($str_1,"yyyy/mm/dd");
print $str_2;

$str1 works, but $str_2 dont.. the print statement is for verification purposes.
Benjamin Krajmalnik
Posted: 12/19/2005, 6:38 PM

The second parameter is an array. Try the following:

$str_2 = CCFormatDate($str_1,array("yyyy","/","mm","/","dd");


timdw

Posts: 25
Posted: 12/19/2005, 6:46 PM

Try (untested):
$str_1 = CCParseDate( CCGetParam("datez"," "), array("dd","-","mm","-","yyyy") );
$str_2 = CCFormatDate( $str_1, array("yyyy","/","mm","/","dd") );

.. and search the help file for ccformatdate. It's quite, err, helpful
;-)
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.