TimeZone Object

ICE Data Services -

TimeZone Object EFS Objects

The TimeZone Object is an object of EFS which represents the time zone of the application [which may be different than local or symbol time] or the time zone in which a symbol is traded. This object is used as parameter in Date Object methods to work with dates regarding needed time zone.

This object can be created only in 'preMain' or 'global' context.


new TimeZone( [ Symbol ] )



Parameter: Description: Default:
Symbol [Optional]  A string representing the symbol. The TimeZone object will be created uses the time zone of the exchange in which this symbol is traded.  

  Time zone of application. This time zone is specified in Application Properties -> Timezone & Clock.


TimeZone Instances Methods

- getName() - returns a string which represents a name of time zone.

- getType() - returns a string which represents the type of time zone.The type of time zone is represented a set of numeric constant:

0 - 'Local Timezone'
1 - 'Greenwich Mean Time'
2 - 'Exchange Timezone'
3 - 'Other'
4 - 'Symbol'

If the parameter 'Symbol' in constructor function is ommited then one of the first four constants is returned (0 - 3) depending on the selected point in Application Properties -> Timezone & Clock. If parameter 'Symbol' is passed then constant '4 - Symbol' is returned.



Only available in versions 12.1 or later.


Code Examples

function preMain(){
    ...TZofApplication = new TimeZone();
	TZname = TZofApplication.getName();
	TZtype = TZofApplication.getType();
	switch (TZtype)	{
		case 0:
			TZtype = 'Local Timezone';
		case 1:
			TZtype = 'Greenwich Mean Time';
		case 2:
			TZtype = 'Exchange Timezone';
		case 3:
			TZtype = 'Other';
		case 4:
			TZtype = 'Symbol';
	debugPrintln('Name: ' + TZname + ', Type: ' + TZtype);...
function preMain(){
    ...TZofApplication = new TimeZone();
	Xmas95 = new Date("December 25, 1995 23:15:00");
	hours = Xmas95.getHours(TZofApplication);
	Xmas95.setHours(5, Xmas95.getMinutes(TZofApplication), Xmas95.getSeconds(TZofApplication), Xmas95.getMilliseconds(TZofApplication), TZofApplication);


See Also

Date Object