Argh ... Is there some reason you didn't want to use Format = 1 ?
THIS WORKS ...
BuyDate = ParamDate("BuyDate","01/03/2006",1);
Title = BuyDate;
--- In [email protected], Ken Close <[EMAIL PROTECTED]> wrote:
>
> TJ: I **ALWAYS** look at the help files, and I tried the
construction you
> suggest, but it did not work.
>
> My title displays "Invalid Date Time" when I use what you suggested.
>
> With the help of some other code, I have solved my problem in the
following
> way but I wonder if there is not another. Why does your suggestion
not work?
>
> Ken
>
> BuyYear = int(BuyDate/10000) + 1900;
>
> BuyMonth = int(((BuyDate) - (BuyYear-1900)*10000)/100);
>
> BuyDay = BuyDate - (BuyYear-1900)*10000 - BuyMonth*100;
>
> BuyDateDisp = NumToStr(BuyMonth,1.0) + "/" + NumToStr(BuyDay,1.0)
+ "/" +
> NumToStr(BuyYear,1.0);
>
> ...." BuyDate = " + BuyDateDisp
>
>
> _____
>
> From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf
> Of Tomasz Janeczko
> Sent: Friday, October 06, 2006 3:48 PM
> To: [email protected]
> Subject: Re: [amibroker] Date Display in Title - Really Puzzling
>
>
> Ken,
>
> Use formatDateTime instead of 1.0 in WriteVal.
> Documented here: http://www.amibroker.com/f?writeval
>
> BuyDate = " + WriteVal(BuyDate,formatDateTime)
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
>
> ----- Original Message -----
> From: Ken Close <mailto:[EMAIL PROTECTED]>
> To: [email protected]
> Sent: Friday, October 06, 2006 6:41 PM
> Subject: [amibroker] Date Display in Title - Really Puzzling
>
> I set a variable with ParamDate, then later want to display that
date in the
> Title statement. I get an incorrect date displayed even though the
variable
> operates correctly and displays correctly as a number.
>
> So, the code has
>
> BuyDate = ParamDate("BuyDate","01/03/2006",0);
>
> Say I set 8/18/2006 in the Parameter box, then later in the code
this
> partial segment in a Title statement
>
> .....+ " BuyDate = " + WriteVal(BuyDate,1.0)
>
> produces this when applied: BuyDate = 1060818 .............
which is
> the correct number but not formatted how I would like it.
>
> Change the code to
> BuyDateDisp = DateTimeToStr(BuyDate);
> and then
> ..... + " BuyDate = " + BuyDateDisp
>
> produces this when applied: BuyDate = 8/2/1073 12:41:00 AM
>
> What is going on and how can I get the formatted date display I
want in the
> Title???
>
> Thanks for any insights.
>
> Ken
>
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/