CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Help - how to use CCFormatDate

Print topic Send  topic

Author Message
Frank Rocco
Posted: 08/02/2002, 10:24 AM

Hello,

I need to create a sql insert statement for mySQL.
How can I convert now() to the correct date format yyyy-mm-dd hh:mm:ss using
CCFormatDate or another function that I am not aware of.

The dates do not get stored if I do a CCToSQL(now(),"Date")

Thanks
Frank

DonB
Posted: 08/02/2002, 7:33 PM

Check the file "Common.Asp" and look at CCFormatDate. You will see the
constructs allowed in the second parameter of this function.

The function allows you to specify the date/time elements you want it to
output (such as the day, month, hour, etc.) from the first parameter - which
must be a valid date/time quantity.

I think that this function and all the CCxxxx functions are written for each
language and therefore you get the ability to format a date the same way
regardless of the language you choose for your project.
So you get different "Common Files" built for you that are written in the
language you chose (PHP, ASP or whatever). The CC functions give you a
consistent and language-neutral set of tools to work with.

"Frank Rocco" <farocco@hotmail.com> wrote in message
news:aief7s$jg6$1@news.codecharge.com...
> Hello,
>
> I need to create a sql insert statement for mySQL.
> How can I convert now() to the correct date format yyyy-mm-dd hh:mm:ss
using
> CCFormatDate or another function that I am not aware of.
>
> The dates do not get stored if I do a CCToSQL(now(),"Date")
>
> Thanks
> Frank
>
>

Frank Rocco
Posted: 08/04/2002, 8:07 AM

Thanks... I am stuck on the second param for CCFormatDate. The formatmask is
confusing me. I'll check Common.asp again to see if I missed the constructs
for this.

Regards,

Frank

donb
Posted: 08/05/2002, 10:48 AM

Pay close attention to the Datemask references, that includes all the
date/time "pieces" (such as "d" for day, "m" for month, etc). You will be
able to assemble the indicated pieces in your format string to get exactly
the representation you want.

Re-reading your original post you said "MySQL" which suggests PHP, not ASP.
If so, the answer is not so clear cut (at least for me). Maybe a PHP expert
will jump in. There are "define"s for things date pieces, which I suppose
mean you can still use the same designations (see the switch..case in
common.php)


"Frank Rocco" <farocco@hotmail.com> wrote in message
news:aijfve$cvm$1@news.codecharge.com...
> Thanks... I am stuck on the second param for CCFormatDate. The formatmask
is
> confusing me. I'll check Common.asp again to see if I missed the
constructs
> for this.
>
> Regards,
>
> Frank
>
>

Frank Rocco
Posted: 08/05/2002, 11:27 AM

DonB,

I found the answer for CCFormatDate.
xdate = CCFormatDate(now(),array("yyyy","-","mm","-","dd","
","hh",":","mm",":","ss"))

Regards,

Frank

Don Anderson
Posted: 09/01/2002, 5:17 AM

Hi there,

For some reason using now() threw up errors when used in the Custom Insert
dialog, so I found this combination:

In the Expression box:

CCFormatDate(time(),array("yyyy","-","mm","-","dd","
","HH",":","nn",":","ss"))

In the format box:

yyyy-mm-dd HH:nn:ss

Cheers,
Don Anderson

"Frank Rocco" <farocco@hotmail.com> wrote in message
news:aimg1n$lmp$1@news.codecharge.com...
> DonB,
>
> I found the answer for CCFormatDate.
> xdate = CCFormatDate(now(),array("yyyy","-","mm","-","dd","
> ","hh",":","mm",":","ss"))
>
> Regards,
>
> Frank
>
>


   


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.