Hello,
I want to get the current time of the bar, while my chart time is not my computer time.
CurrentTime is giving me the time of my computer
Time is giving me the time when the bar will close
That means that if I have a 15 mins chart, and now the time in my chart is 12:13, I want to be able to get this time.
'Time' will give me in this case 1215 and not 1213
'CurrentTime' will give me 19:13 and I can't do anything with that.
Any solution?
Thanks
Time / CurrentTime
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Time / CurrentTime
are you using the Premium version or the Discretionary version?Hello,
I want to get the current time of the bar, while my chart time is not my computer time.
CurrentTime is giving me the time of my computer
Time is giving me the time when the bar will close
That means that if I have a 15 mins chart, and now the time in my chart is 12:13, I want to be able to get this time.
'Time' will give me in this case 1215 and not 1213
'CurrentTime' will give me 19:13 and I can't do anything with that.
Any solution?
Thanks
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Time / CurrentTime
Sorry for the late reply. Must have missed it because of the Christmas happenings.Hello,
I want to get the current time of the bar, while my chart time is not my computer time.
CurrentTime is giving me the time of my computer
Time is giving me the time when the bar will close
That means that if I have a 15 mins chart, and now the time in my chart is 12:13, I want to be able to get this time.
'Time' will give me in this case 1215 and not 1213
'CurrentTime' will give me 19:13 and I can't do anything with that.
Any solution?
Thanks
You can add an adjustment to the time
eg.
Code: Select all
input:
time.adjustment(600);
var:
corrected.time(0);
corrected.time = currenttime - time.adjustment;
ps. This is only a concept. For proper time adjustments, you will need to use time serial numbers.
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Time / CurrentTime
For example:ps. This is only a concept. For proper time adjustments, you will need to use time serial numbers.
Code: Select all
Inputs:
TimeZoneOffSet(0);
// To display the time in another regionale, enter whole hours here, for example -5 or 3
Variables:
tzOffset(ELTimeToDateTime(TimeZoneOffSet * 100)); // Time zone offset in DateTime format
Print("Time zone adjusted time: ", FormatTime(" HH:mm:ss ", ELTimeToDateTime_s(CurrentTime_s) + tzOffset) );