Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the file.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
We have no idea what result[0] and result[1] are.
Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the file.
How To Ask Questions The Smart Way. (2004)
Be precise and informative about your problem
We have no idea what result[0] and result[1] are.
Hey William,
Let me post the full code
datetime DateRecon=TimeLocal(); int year,day,month,hour; year = TimeYear(DateRecon); day = TimeDay(DateRecon); month = TimeMonth(DateRecon); hour = TimeHour(DateRecon); DateRecon=StrToTime(year+"."+month+"."+day+" "+hour+":"+05+":"+55); Comment(DateRecon);
I get
2021.11.30 18:05:00
Like I said the seconds is always 00
I dont understand why.
Hope you can help!
Thanks!
Audai Louri #:
2021.11.30 18:05:00
Because StrToTime always returns "yyyy.mm.dd hh:mi". No seconds.
Try the following;
DateRecon = StrToTime((string)year + "." + (string)month + "." + (string)day + " " + (string)hour + ":" + (string)05); Comment(TimeToStr(DateRecon + 55, TIME_DATE|TIME_SECONDS));
This is incorrect, while documentation says the input format is "yyyy.mm.dd hh:mi" , but it returns the seconds as well. The problem is in the formatting as one digit numbers are converted to one character text, so if the minute is 5, the string will be "18:5:55". Try formatting your string correctly or you will get same problems in converting month, day and hour as well.
This is incorrect, while documentation says the input format is "yyyy.mm.dd hh:mi" , but it returns the seconds as well. The problem is in the formatting as one digit numbers are converted to one character text, so if the minute is 5, the string will be "18:5:55". Try formatting your string correctly or you will get same problems in converting month, day and hour as well.
Oh, yes, indeed.
I misunderstood the output format as "yyyy.mm.dd hh:mi".
The reason is that he did not convert int to string in the original program.
DateRecon=StrToTime(year+"."+month+"."+day+" "+hour+":"+05+":"+55);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everyone,
I have this weird issue when reconstructing a date it is showing the seconds 00. Sometimes it doesnt do that and shows it properly. I honestly have no idea why its working and not working but here is my code.
The output works to the min. Except the Secs shows 00. And sometimes it works. It's like it decides when to work and when not to work.
Any advice on this matter would be highly appreciated.
Thank you,
P.s. Even if I replace result[1] with a number it still shows secs as :00