Hello, So you don't trust the user ? Come on, you need a little faith :-)
But seriously: you can find out what timezone the user has set in Windows (because it is also configurable in Windows Control Panel) using Windows API http://msdn.microsoft.com/en-us/library/ms724421(VS.85).aspx or JScript: getTimezoneOffset(); method of Date object. http://msdn.microsoft.com/en-us/library/014ykh71(VS.85).aspx Best regards, Tomasz Janeczko amibroker.com ----- Original Message ----- From: "Conrad Joach" <[email protected]> To: <[email protected]> Sent: Wednesday, April 01, 2009 3:09 PM Subject: [amibroker] Re: What's the safest way to get GMT from a bar time? > Right, but the problem is my plugin or AFL script wants to know what the > current time zone is in, because my plugin has data that > is in GMT, so when it gets bar data, it needs to know how to convert it to > GMT. > > I can't rely on knowing because they user may set it to something themselves, > so is there a way to know from script what the user > has shifted their timezone too? Or is the only way me to know is to have a > parameter in my AFL indicator that requests that the > user specify the timezone? That is perfectly fine as well if need be, > although slightly inelegant. > > Thanks. > > --- In [email protected], "Tomasz Janeczko" <gro...@...> wrote: >> >> Hello, >> >> That depends on data source you are using. If you are using eSignal - it is >> universal time, >> if you use IQFeed, it is US EST time, if you are using Interactive Brokers - >> it is your local time. >> >> Now, AmiBroker has ability to shift timestamps on the fly. >> Please go to File->Database Settings->Intraday Settings >> "Time Shift" field and enter positive or negative time shift you need. >> >> This process is non-destructive and does not affect the operation of the >> plugin >> or the underlying data. >> >> The timeshift can be changed and it is applied on the fly, so all datetimes >> in program reflect the change immediatelly, but underlying data source is >> not modified in any way. >> >> Best regards, >> Tomasz Janeczko >> amibroker.com >> ----- Original Message ----- >> From: "Conrad Joach" <consolejo...@...> >> To: <[email protected]> >> Sent: Wednesday, April 01, 2009 5:33 AM >> Subject: [amibroker] What's the safest way to get GMT from a bar time? >> >> >> > Seems that the time is set in local time based on the user's PC? Is that >> > correct? I would like my AFL to past to my plugin the >> > time of a given bar, but in GMT, which requires knowing what timezone that >> > AmiBroker is running on. >> > >> > >> > >> > ------------------------------------ >> > >> > **** IMPORTANT PLEASE READ **** >> > This group is for the discussion between users only. >> > This is *NOT* technical support channel. >> > >> > TO GET TECHNICAL SUPPORT send an e-mail directly to >> > SUPPORT {at} amibroker.com >> > >> > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at >> > http://www.amibroker.com/feedback/ >> > (submissions sent via other channels won't be considered) >> > >> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: >> > http://www.amibroker.com/devlog/ >> > >> > Yahoo! Groups Links >> > >> > >> > >> > > > > > ------------------------------------ > > **** IMPORTANT PLEASE READ **** > This group is for the discussion between users only. > This is *NOT* technical support channel. > > TO GET TECHNICAL SUPPORT send an e-mail directly to > SUPPORT {at} amibroker.com > > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at > http://www.amibroker.com/feedback/ > (submissions sent via other channels won't be considered) > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > http://www.amibroker.com/devlog/ > > Yahoo! Groups Links > > >
