No. You can obtain millisecond resolution with GetTickCount function only.
You can use WinAPI functions. See example
You can use WinAPI functions. See example
//+------------------------------------------------------------------+ //| LocalTime.mq4 | //| Copyright © 2006, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #import "kernel32.dll" void GetLocalTime(int& TimeArray[]); #import //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { int TimeArray[4]; int nYear,nMonth,nDay,nHour,nMin,nSec,nMilliSec; //---- GetLocalTime(TimeArray); Print(GetLastError()); nYear=TimeArray[0]&0x0000FFFF; nMonth=TimeArray[0]>>16; nDay=TimeArray[1]>>16; nHour=TimeArray[2]&0x0000FFFF; nMin=TimeArray[2]>>16; nSec=TimeArray[3]&0x0000FFFF; nMilliSec=TimeArray[3]>>16; Print(nYear,".",nMonth,".",nDay," ",nHour,":",nMin,":",nSec,":",nMilliSec); //---- return(0); } //+------------------------------------------------------------------+
Thanks for the example Slawa!
-charliev
-charliev
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
Is there anyway to get millisecond resolution out of any TIME variable?
Thanks,
-charliev