You have created the CDatetime object "time" but you didn't set a value to it.
It prints "Sunday" because it returns 0.
time.DateTime(TimeCurrent()); Print("Day: ", time.DayName());

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi! I was trying to use the datetime feature to know the day of the week but I kept getting "Sunday", yet it's a Thursday.
I developed this code to check the problem in the code. Run this and see
It prints bad month. Using:
...prints wrong day. where is the problem really? I'm lost.