Convert date and time buffer into yyyy.mm.dd

 

Hello,
I have indicator that currently has 1 buffer for buy signal and a buffer that record the date and time for the prior buysignal, say the name is buy1datetime.

buy1datetime[i]=Time[i];

The problem is that this buy1date1time value is in second pass ince 1.1.1970.

I want to turn it into yyyy.mm.dd hh:ss

How can I do that?

I try to set the buffer for buy1date1time in the format : double, datetime but none works.

Many thanks.

SCFX

 
scfx:

Hello,
I have indicator that currently has 1 buffer for buy signal and a buffer that record the date and time for the prior buysignal, say the name is buy1datetime.

buy1datetime[i]=Time[i];

The problem is that this buy1date1time value is in second pass ince 1.1.1970.

I want to turn it into yyyy.mm.dd hh:ss

Use TimeToStr()
 

Hi RapterUK,

I did try this function

string buy1datetime[];

...

buy1datetime[l]=TimeToStr(Time[l], TIME_DATE|TIME_SECONDS);

But still there is nothing show up in the buffer buy1datetime in the data-window.

Could you tell me what I did wrong?


Thanks,

SCFX

 
If buy1datetime[] is a buffer then it MUST be a double. It can NOT EVER be a datetime. The data-window shows VALUES, never a datetime.
 

Thanks man.

SCFX

Reason: