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
TimeSeconds(TimeCurrent());
Thank you very much, I think this makes sense (i'm very green) :-)
Would this tell me the time in seconds to 1970 from the current time? I think it should - my output I get though is "1" - would this be because I need to store it in some "long" variable first because most of the number is being chopped off?
I have already stated that you cannot use the function "TimeSeconds()" and that you must instead use typecasting to long. Please read the entire thread again and especially my original post. Here it is again:
As for your most recent post, you should use typecasting as a long:
You can also typecast in the form of a function if that makes it easier for you to visualise the code flow:
I don't usually use the "PrintFormat()" function, but you will have to use "long" formatting instead of "int" if you want to be safe for dates in the future past 2037.
In that case, if strict mode should always be used, then explicit typecasting IS NEEDED for outputting with the standard "Print()" (contrary to your original statement).
I was not taking it personal! I was just responding to your statement, which it seems now that both you and I were wrong about, as "GumRai" has pointed out.
Except I never wrote what you seem to think I wrote.
My point was to say an explicit typecasting (using a new variable or not) is NOT needed just to output a date as a number of seconds, and this completely independently of strict mode.
Are you serious ? Are you really thinking to still use mql4 code in 2037 ? But ok you are right.
Yes, I am serious - In order to future-proof your code! You never know how your code could be re-purposed in the future, by you or any person you share it with (such as here on this forum).
Not doing it is the same thinking that caused so many Y2K problems; because people believed that their code would never be used for any long period of time beyond 1999. The result was the mass panic in a haste to patch everything, and even so, there was still many hiccups.
Except I never wrote what you seem to think I wrote.
My point was to say an explicit typecasting (using a new variable or not) is NOT needed just to output a date as a number of seconds, and this completely independently of strict mode.
No, you don't need to "assign" it to a variable, but you do need to typecast it, as the example below (for "strict" case):
No, you don't need to "assign" it to a variable, but you do need to typecast it, as the example below (for "strict" case):
You don't need an explicit typecasting with this code to prove it :
Can I know why you are insisting on this point ?
You don't need an explicit typecasting with this code to prove it :
Can I know why you are insisting on this point ?
I am insisting on this point because you are mixing apples and oranges.
As I stated, typecasting IS NEEDED when using "Print()" not when using "PrintFormat()". They are different functions that work differently!
I am insisting on this point because you are mixing apples and oranges.
As I stated, typecasting IS NEEDED when using "Print()" not when using "PrintFormat()". They are different functions that work differently!
Please calm down. I never said typecasting is not needed when using print. I just added something more to your first post, and from there you make all a fuss for nothing.
So, is it ok now ?
Please calm down. I never said typecasting is not needed when using print. I just added something more to your first post, and from there you make all a fuss for nothing.
I am calm, but why is it that when I contradict one your statements you justify it as saying that you knew about it but were just offering an alternative.
When you contradict me for a wrong statement, I concede that I was wrong as I have done twice today.