Don't do that. Someone searching might find this thread and still be clueless. What was the problem? What solved what?
How To Ask Questions The Smart Way. 2004
When You Ask.
Follow up with a brief note on the solution.
I don't know "what was the problem?"... It just doesn't work right.
To fix this you need:
Get the datetime as a "long" variable and multiply it by 1000
long tc = TimeCurrent()*1000;
After that, you need to do some math... I will not explain what I do, read about "Unix time" and you will understand
https://en.wikipedia.org/wiki/Unix_time
long millis = tc % 1000;
long second = (tc / 1000) % 60;
long minute = (tc / (1000 * 60)) % 60;
long hour = (tc / (1000 * 60 * 60)) % 24;
And all code will look like this:
long tc = TimeCurrent()*1000; long millis = tc % 1000; long second = (tc / 1000) % 60; long minute = (tc / (1000 * 60)) % 60; long hour = (tc / (1000 * 60 * 60)) % 24; Print(hour, ":", minute, ":", second,":", millis);

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
If I use the TimeToString function, I get time in 12-hours format.
The output looks like this:
First: what I do not like about this output is that I don't know whether it is am or pm now. How to know it ?
Second: For me more convenient 24-hours format. Can I convert the datetime to 24-hours string format by using standard libraries ?