CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Change date format from String

Print topic Send  topic

Author Message
Khong_biet
Posted: 07/30/2004, 9:46 PM

Please help me to convert string to Date format
When I select data from table, dateopinion is date format and when show to web it is running but date format is yyyy-mm-dd
How can I change date format to dd/mm/yyyy
Thank
My code:

global $Docreceive_Docattribute_K;
global $ngay_y_kien;
// Write your own code here.
$tam=$Docreceive_Docattribute_K->Docattribute_docid->getvalue();

$db = new clsDBConnection2();
$SQL= "SELECT docid, opinion, dateopinion, lastname FROM Opinion INNER JOIN Employee ON
Opinion.username = Employee.username";

$db->query($SQL);
$temp="";
while ($db->next_record())
{
$docid=$db->f("docid");
if ($docid==$tam)
{
$ngay_tam =$db->f("dateopinion");
$nguoi_tam = $db->f("lastname");
$y_kien = $db->f("opinion");
$temp = $temp."-->.": ".$nguoi_tam.": ".$y_kien."; ";
}
}
$Docreceive_Docattribute_K->ykien->SetValue($temp);
$db->close();


hidran

Posts: 29
Posted: 08/02/2004, 9:06 AM

use date_format(dateopinion,'%m /%d/%Y) in your query
or in php str_replace('-','/',$ngay_tam)
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.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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