1/ i want to get the begin time of my localcation ,may i write code like this ? int begintime = TimeLocal() -TimeHour(TimeLocal() )*3600-60 * TimeMinute(TimeLocal() ) - TimeSeconds(TimeLocal() ); 2/ D'2013.02.24 00:11' refers mt4 severtime or my local time ? thanks
- [ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5.
- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
- Starts EA just after 6am GMT. How could I do this?
YALEWANG:
1/ i want to get the begin time of my localcation ,may i write code like this ? int begintime = TimeLocal() -TimeHour(TimeLocal() )*3600-60 * TimeMinute(TimeLocal() ) - TimeSeconds(TimeLocal() ); 2/ D'2013.02.24 00:11' refers mt4 severtime or my local time ? thanks
TimeLocal() you can read the documentation
1/ i want to get the begin time of my localcation ,may i write code like this ? int begintime = TimeLocal() -TimeHour(TimeLocal() )*3600-60 * TimeMinute(TimeLocal() ) - TimeSeconds(TimeLocal() ); 2/ D'2013.02.24 00:11' refers mt4 severtime or my local time ? thanks
#define HR2400 86400 // 24 * 3600 int TimeOfDay(datetime when){ return( when % HR2400 ); } datetime DateOfDay(datetime when){ return( when - TimeOfDay(when) ); }
D'2013.02.24 00:11' refers mt4 severtime or my local time ?
YALEWANG:
D'2013.02.24 00:11' refers mt4 severtime or my local time ?
D'2013.02.24 00:11' refers mt4 severtime or my local time ?
servertime
YALEWANG:
D'2013.02.24 00:11' refers mt4 severtime or my local time ?
Either, LocalTime() is the time on your PCs clock, did you read the documentation ?
D'2013.02.24 00:11' refers mt4 severtime or my local time ?
YALEWANG:
i have just test it ,it should be local time .
<CODE REMOVED>
Please edit your post . . .
i have just test it ,it should be local time .
int init() { Print(TimeLocal()-(D'2013.02.23 20:30')); //Print(TimeCurrent()-(D'2013.02.23 20:30')); return(0); }
i can now use SRC
YALEWANG:
i have just test it ,it should be local time .
Question was "refers mt4 severtime or my local time"
This moment it is weekend and the chart of your MT4 platform is not updating new bars
The chart is running the time of your broker Datetime is just a counting of seconds from moment 1 jan 1970 (check it to be sure)
We living on a world where we didn't start all same moment with 1 jan 1970
but we all pass a moment we arrive D'2013.02.23 20:30'

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