TimeZones Class |
Typically you should obtain a TimeZones collection from the application via TimeZones. That collection is constructed by the application at startup and properly loaded from the registry.
In addition to the timezones loaded from the server's Windows registry, a number of special timezones are predefined in the collection:
To perform a timezone conversion between arbitrary timezones you can use Convert(String, String, DateTime) or Convert(Int32, Int32, DateTime) which will return a date/time even if one or both timezones are unknown (in which case the date/time value is returned without any conversion). For more more control you can first get the source TimeZone and call Convert(TimeZone, DateTime) providing the destination TimeZone.
Namespace: NetQuarry
The TimeZones type exposes the following members.
Name | Description | |
---|---|---|
TimeZones |
Constructor
| |
TimeZones(Int32) |
Constructor
|
Name | Description | |
---|---|---|
Count |
The number of elements actually contained in the ArrayList.
(Inherited from EAPCollectionBase.) | |
IsFixedSize |
true if the ArrayList has a fixed size; otherwise, false. The default is false.
(Inherited from EAPCollectionBase.) | |
IsReadOnly |
Returns true if the collection is read-only. (Default is false)
(Inherited from EAPCollectionBase.) | |
IsSynchronized |
true if access to the internal ArrayList is synchronized (thread-safe); otherwise, false. The default is false.
(Inherited from EAPCollectionBase.) | |
Item |
Look up a timezone by key (ID).
| |
ServerLocalTimeZone |
Get/set the server's local timezone, if any.
If there is a user local timezone it is stored at index -2.
| |
SyncRoot |
An object that can be used to synchronize access to the ArrayList.
(Inherited from EAPCollectionBase.) | |
UserLocalDateTime | ||
UserLocalTimeZone |
Get/set the user's local timezone, if any.
If there is a user local timezone it is stored at index -1.
| |
UTCTimeZone |
Get/set the Coordinated Universal Time (UTC) timezone which is guaranteed to exist on a properly loaded collection.
The UTC timezone is always stored at index 0.
|
Name | Description | |
---|---|---|
Add(TimeZone) |
Adds a TimeZone to the collection with the appropriate key.
| |
Add(String, Object) |
Adds an object to the collection. Override. This method simply calls the Add method with CollectionAddFlags.replace as the flags.
(Inherited from EAPCollectionBase.) | |
Add(Int32, TimeZone) |
Adds a TimeZone to the collection with the specified key.
| |
Add(String, Object, CollectionAddFlags) |
Adds an item to the collection
(Inherited from EAPCollectionBase.) | |
AddAt |
Adds an item to the collection at the specified index. To append an item use -1 or
the collection item count as the index.
(Inherited from EAPCollectionBase.) | |
Clear |
Clears the collection
(Inherited from EAPCollectionBase.) | |
Clone |
Returns a copy of this object.
| |
Contains |
Determines whether an element is in the collection.
(Inherited from EAPCollectionBase.) | |
ContainsKey |
Checks for the existence of an item in the hashtable
(Inherited from EAPCollectionBase.) | |
Convert(Int32, Int32, DateTime) |
Converts a date/time between two arbitrary timezones. If either the source or destination timezones
are not known then the unconverted date/time is returned. Note that as elsewhere you can use 0 for
UTC and -1 for the user local timezone.
| |
Convert(String, String, DateTime) |
Converts a date/time between two arbitrary timezones. If either the source or destination timezones
are not known then the unconverted date/time is returned. Note that as elsewhere you can use "0"
for UTC and "." or "-1" for the user local timezone.
| |
CopyTo |
Copies the entire ArrayList to a compatible one-dimensional Array, starting at the beginning of the target array.
(Inherited from EAPCollectionBase.) | |
CreateInstance |
Creates a new instance of TimeZones and loads it. If the cache metadata property is set
on the application object, then the object is loaded from the cache.
| |
Equals | (Inherited from Object.) | |
Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
Find |
Find a timezone per the specified search.
| |
GetEnumerator |
Returns an enumerator that can iterate through the ArrayList.
(Inherited from EAPCollectionBase.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetItem(Int32) |
Returns an item that matches the specified string index
(Inherited from EAPCollectionBase.) | |
GetItem(String) |
Returns an item that matches the specified string index
(Inherited from EAPCollectionBase.) | |
GetItemName |
Returns the name of the item.
(Overrides EAPCollectionBaseGetItemName(Object).) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IndexOf |
Returns the zero-based index of the first occurrence of an object in the internal ArrayList or in a portion of it.
(Inherited from EAPCollectionBase.) | |
IndexOfKey |
Returns the index of the item in the collection (by key)
(Inherited from EAPCollectionBase.) | |
Insert |
Inserts an element into the internal ArrayList at the specified index
(Inherited from EAPCollectionBase.) | |
IsMarkedForDeletion |
Determines if this element is marked for deletion. Note that this base implementation
must be overridden in order to support RemoveMarkedItems() for a partular collection.
(Inherited from EAPCollectionBase.) | |
IsTypeOK |
Verifies the item is an acceptable type.".
(Overrides EAPCollectionBaseIsTypeOK(Object).) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
RecalcHash |
Recalculates the internal hash
(Inherited from EAPCollectionBase.) | |
Remove(Object) |
Removes the first occurrence of a specific object from the collection
(Inherited from EAPCollectionBase.) | |
Remove(String) |
Remove the specified item from the collection.
(Inherited from EAPCollectionBase.) | |
RemoveAt |
Removes the element at the specified index
(Inherited from EAPCollectionBase.) | |
RemoveMarkedItems |
Removes the properties marked for deletion.
(Inherited from EAPCollectionBase.) | |
RemoveRange |
Removes the element at the specified index
(Inherited from EAPCollectionBase.) | |
SetItem(Int32, Object) |
Sets an item's value at the specified index.
(Inherited from EAPCollectionBase.) | |
SetItem(String, Object) |
Sets an item's value at the string index indicated by the parameters.
(Inherited from EAPCollectionBase.) | |
Sort(Boolean) |
Sort the list by its key value.
(Inherited from EAPCollectionBase.) | |
Sort(IComparer) |
Sort the collection using the provided comparer.
(Inherited from EAPCollectionBase.) | |
ToString | (Inherited from Object.) | |
Truncate |
Truncate the array starting at the specified index.
(Inherited from EAPCollectionBase.) | |
Unload |
Called when the collection is cleared allowing a derived class to clean up.
(Inherited from EAPCollectionBase.) |
Name | Description | |
---|---|---|
EqualValue |
Determines if the object value is equal to another object. If the two objects are null, then this returns true.
There is special handling for guid comparisons (since a guid could be a string formatted in up to 3 different ways).
If the special guid handling is not performed, then the object.Equals method is used.
(Defined by EAPUtil.) |