Get timestamp as a var

Posted By: tomaslolo

Get timestamp as a var - 03/24/23 17:00

Hello, is it possible to get timestamp as a var value?

I wat to add timestams as a signal, for using it with adviseLong / Short function I´m trying this:

For example, using Deeplearn.c you get these signals:

Quote
change(1),change(2),change(3),change(4),
range(1),range(2),range(3),range(4)


I wat to add timestamp, but with its usual format, I mean, 20190228 11:58:34

I´ve tried this:
Code
   string datetime_str = strdate("+%Y-%m-%d %H:%M:%S", wdate(0));
    var datetime_var = date(datetime_str);


but does not work. Any clue?

Thank you!
Posted By: Petra

Re: Get timestamp as a var - 03/24/23 17:22

var datetime_var = wdate(0)
Posted By: tomaslolo

Re: Get timestamp as a var - 03/24/23 18:26

Thank you, but it returns these values:

42401.00000
42401.01042
42401.02083
42401.03125
42401.04167
42401.05208
42401.06250


I would like to return these instead:

20160201 00:00:00
© 2024 lite-C Forums