Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

IDSSTime Interface Reference

Inherited by IDSSTime2.

List of all members.


Detailed Description

Time representation using IDSSTime gives some zone independence.

This is done using the Mode property and is explained in detail below.

This interface can also be used to represent times (or rather dates, but we represent days also as times with some default values for hour, minute, seconds and milliseconds, if no values are specified for these properties) such as this day last year. These are explained in the DynamicTime property explanation below.


Public Member Functions

HRESULT DateTime ([in] DATE Date)
 The actual time point that the interface represents.
HRESULT DateTime ([out, retval] DATE *pDate)
 The actual time point that the interface represents.
HRESULT Day ([in] Int32 Day)
 If IsGmt is TRUE (non-zero), then the Day corresponds to time according to GMT.
HRESULT Day ([out, retval] Int32 *pDay)
 If IsGmt is TRUE (non-zero), then the Day corresponds to time according to GMT.
HRESULT DayOfWeek ([in] EnumDSSDayOfWeek DayOfWeek)
 If IsGmt is TRUE (non-zero), then the DayOfWeek corresponds to time according to GMT.
HRESULT DayOfWeek ([out, retval] EnumDSSDayOfWeek *pDayOfWeek)
 If IsGmt is TRUE (non-zero), then the DayOfWeek corresponds to time according to GMT.
HRESULT Difference ([in] IDSSTime *pTime,[in] EnumDSSTimeGranularityLevel Level,[out, retval] IDSSTimePeriod pTimePeriod)
 At the specified granularity level, get methods are called on the current time and the time passed and the difference is found.
HRESULT DynamicDayOffset ([in] Int32 DynamicDayOffset)
 This is applicable only for dynamic time points.
HRESULT DynamicDayOffset ([out, retval] Int32 *pDynamicDayOffset)
 This is applicable only for dynamic time points.
HRESULT DynamicTime ([in] EnumDSSDynamicTime DynamicTime)
 IDSSTime interface views time as two hierarchies of levels: Year-Month-Week-DayOfWeek-Hour-Minutes-Seconds-MilliSeconds and Year-Month-Day-Hour-Minutes-Seconds-MilliSeconds.
HRESULT DynamicTime ([out, retval] EnumDSSDynamicTime *pDynamicTime)
 IDSSTime interface views time as two hierarchies of levels: Year-Month-Week-DayOfWeek-Hour-Minutes-Seconds-MilliSeconds and Year-Month-Day-Hour-Minutes-Seconds-MilliSeconds.
HRESULT Format ([in] BSTR Format,[in, defaultvalue(-1)] Int32 Locale,[out, retval] BSTR *oOutputString)
 The format of the date and/or time (Format) is a string pattern, with substitutable placeholders defined as follows.
HRESULT GetNthTimePointBefore ([in] Int32 n,[in] EnumDSSTimeGranularityLevel Level,[out, retval] IDSSTime ppTime)
 Get an absolute time a integer number of time units before this time.
HRESULT GetShift ([in] Int32 level,[out, retval] Int32 *pShift)
 This method is applicable only for dynamic time points.
HRESULT Hour ([in] Int32 Hour)
 If IsGmt is TRUE (non-zero), then the Hour corresponds to time according to GMT.
HRESULT Hour ([out, retval] Int32 *pHour)
 If IsGmt is TRUE (non-zero), then the Hour corresponds to time according to GMT.
HRESULT Init ()
 This method should be called before any get property or method is called.
HRESULT IsEqualTo ([in] IDSSTime *pTime,[out, retval] VARIANT_BOOL *pBool)
 Returns true if both the time points represent the same point of time.
HRESULT IsGmt ([in] VARIANT_BOOL IsGmt)
 The IsGmt flag being a VARIANT_BOOL can be TRUE or FALSE.
HRESULT IsGmt ([out, retval] VARIANT_BOOL *pIsGmt)
 The IsGmt flag being a VARIANT_BOOL can be TRUE or FALSE.
HRESULT IsGreaterThan ([in] IDSSTime *pTime,[out, retval] VARIANT_BOOL *pBool)
 Returns true if the time represented by the current time point is after the time point represented by the time point passed.
HRESULT IsLessThan ([in] IDSSTime *pTime,[out, retval] VARIANT_BOOL *pBool)
 Returns true if the time represented by the current time point is before the time point represented by the time point passed.
HRESULT MilliSeconds ([in] Int32 MilliSeconds)
 If IsGmt is TRUE (non-zero), then the MilliSeconds correspond to time according to GMT.
HRESULT MilliSeconds ([out, retval] Int32 *pMilliSeconds)
 If IsGmt is TRUE (non-zero), then the MilliSeconds correspond to time according to GMT.
HRESULT Minutes ([in] Int32 Minutes)
 If IsGmt is TRUE (non-zero), then the Minutes correspond to time according to GMT.
HRESULT Minutes ([out, retval] Int32 *pMinutes)
 If IsGmt is TRUE (non-zero), then the Minutes correspond to time according to GMT.
HRESULT Mode ([in] EnumDSSDateTimeMode Mode)
 Mode that determines the nature of the time point.
HRESULT Mode ([out, retval] EnumDSSDateTimeMode *pMode)
 Mode that determines the nature of the time point.
HRESULT Month ([in] EnumDSSMonth Month)
 If IsGmt is TRUE (non-zero), then the Month corresponds to time according to GMT.
HRESULT Month ([out, retval] EnumDSSMonth *pMonth)
 If IsGmt is TRUE (non-zero), then the Month corresponds to time according to GMT.
HRESULT Name ([in] BSTR Name)
 Stores a name for this time point.
HRESULT Name ([out, retval] BSTR *pName)
 Stores a name for this time point.
HRESULT PopulateDefn ([in] IDSSTime *pTime)
 Populate the current time point using the time point passed.
HRESULT Seconds ([in] Int32 pSeconds)
 If IsGmt is TRUE (non-zero), then the Seconds correspond to time according to GMT.
HRESULT Seconds ([out, retval] Int32 *pSeconds)
 If IsGmt is TRUE (non-zero), then the Seconds correspond to time according to GMT.
HRESULT Shift ([in] IDSSTimePeriod *pTimePeriod,[out, retval] IDSSTime pTime)
 Shift the current time point by the amount of time represented by the Time Period object.
HRESULT Text ([in] BSTR Text,[in, defaultvalue(-1)] Int32 Locale)
 The time point is computed from a given string.
HRESULT Week ([in] Int32 MonthWeek)
 If IsGmt is TRUE (non-zero), then the DayOfWeek corresponds to time according to GMT.
HRESULT Week ([out, retval] Int32 *pMonthWeek)
 If IsGmt is TRUE (non-zero), then the DayOfWeek corresponds to time according to GMT.
HRESULT Year ([in] Int32 Year)
 If IsGmt is TRUE (non-zero), then the Year corresponds to time according to GMT.
HRESULT Year ([out, retval] Int32 *pYear)
 If IsGmt is TRUE (non-zero), then the Year corresponds to time according to GMT.


Member Function Documentation

HRESULT IDSSTime::DateTime [in] DATE  Date  ) 
 

The actual time point that the interface represents.

This property can be used to manipulate the underlying time of an IDSSTime interface.
IsGmt If TRUE, the time returned (or set) will be in GMT.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::DateTime [out, retval] DATE *  pDate  ) 
 

The actual time point that the interface represents.

This property can be used to manipulate the underlying time of an IDSSTime interface.
IsGmt If TRUE, the time returned (or set) will be in GMT.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Day [in] Int32  Day  ) 
 

If IsGmt is TRUE (non-zero), then the Day corresponds to time according to GMT.

If not, it is according to the local time.

Note that, Day should not be set if Week and DayOfWeek are set.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Day [out, retval] Int32 *  pDay  ) 
 

If IsGmt is TRUE (non-zero), then the Day corresponds to time according to GMT.

If not, it is according to the local time.

Note that, Day should not be set if Week and DayOfWeek are set.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::DayOfWeek [in] EnumDSSDayOfWeek  DayOfWeek  ) 
 

If IsGmt is TRUE (non-zero), then the DayOfWeek corresponds to time according to GMT.

If not, it is according to the local time.

Instead of long values, the enumeration EnumDSSDayOfWeek ={DssSunday, DssMonday, DssTueday, ...}can be used.
Note that, Day should not be set if Week and DayOfWeek are set.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::DayOfWeek [out, retval] EnumDSSDayOfWeek pDayOfWeek  ) 
 

If IsGmt is TRUE (non-zero), then the DayOfWeek corresponds to time according to GMT.

If not, it is according to the local time.

Instead of long values, the enumeration EnumDSSDayOfWeek ={DssSunday, DssMonday, DssTueday, ...}can be used.
Note that, Day should not be set if Week and DayOfWeek are set.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Difference [in] IDSSTime pTime,
[in] EnumDSSTimeGranularityLevel  Level,
[out, retval] IDSSTimePeriod   pTimePeriod
 

At the specified granularity level, get methods are called on the current time and the time passed and the difference is found.

This difference is returned in the Time Period object. The other level members in the time period object are set to 0.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::DynamicDayOffset [in] Int32  DynamicDayOffset  ) 
 

This is applicable only for dynamic time points.

The current time is shifted by the number of days specified in the dynamicdayoffset and then the dynamic time point is evaluated with respect to the new current time. For example if today is March 5th, and we have a dynamic time that represents the last day of this month. If the dynamicdayoffset is set to -7, the current time is shifted back by 7 days, and the dynamic time is computed with respect to that day (which is Feb 27th if it is not a leap year). The last day of the month would then be Feb 28th.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::DynamicDayOffset [out, retval] Int32 *  pDynamicDayOffset  ) 
 

This is applicable only for dynamic time points.

The current time is shifted by the number of days specified in the dynamicdayoffset and then the dynamic time point is evaluated with respect to the new current time. For example if today is March 5th, and we have a dynamic time that represents the last day of this month. If the dynamicdayoffset is set to -7, the current time is shifted back by 7 days, and the dynamic time is computed with respect to that day (which is Feb 27th if it is not a leap year). The last day of the month would then be Feb 28th.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::DynamicTime [in] EnumDSSDynamicTime  DynamicTime  ) 
 

IDSSTime interface views time as two hierarchies of levels: Year-Month-Week-DayOfWeek-Hour-Minutes-Seconds-MilliSeconds and Year-Month-Day-Hour-Minutes-Seconds-MilliSeconds.

The time represented by a dynamic time change with time. For example, the time (or date) represented by last month changes as time changes.

IDSSTime represents dynamic times using the Dynamic Time property and the properties at various levels such as Year, Month etc. The Dynamic Time property that acts as the seed for all the possible dynamic times we can represent can only take values from the EnumDSSDynamicTime enumeration.
Note that the DynamicTime values are each at a particular level. We follow two simple rules to generate more dynamic times.
1) The levels below the level at which the dynamic time is specified are used to further refine the time being specified. For instance, if the dynamic time is ThisMonth, then if the Day value is 3 it is considered as the 3rd day of this month. If it is -3 it is considered as the 3rd last day of the month.
2) The levels at and above are considered as offsets to the time obtained by putting together the lower levels. For example, if the dynamic time is ThisMonth and the Year value is +2, then we are referring to this month two years hence. If it is -1, then it is last year this month.
Note that, when the month and DayOfWeek values are used as offsets i.e. the DynamicTime is at or below this level, the corrresponding numeric values are taken as the offsets.
We have the following examples:
  • Last Day of Last Month: DynamicTime is DssTimeThisMonth. Month property is -1, Day property is -1.
  • 3rd Sunday of Last Month: DynamicTime is DssTimeThisMonth. Month property is -1, Week property is 3 and DayOfWeek is Sunday.
  • 3 years, 2 months and 3 days ago: DynamicTime is DssTimeToday, Year is -3, Month is -2, Day is -3.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::DynamicTime [out, retval] EnumDSSDynamicTime pDynamicTime  ) 
 

IDSSTime interface views time as two hierarchies of levels: Year-Month-Week-DayOfWeek-Hour-Minutes-Seconds-MilliSeconds and Year-Month-Day-Hour-Minutes-Seconds-MilliSeconds.

The time represented by a dynamic time change with time. For example, the time (or date) represented by last month changes as time changes.

IDSSTime represents dynamic times using the Dynamic Time property and the properties at various levels such as Year, Month etc. The Dynamic Time property that acts as the seed for all the possible dynamic times we can represent can only take values from the EnumDSSDynamicTime enumeration.
Note that the DynamicTime values are each at a particular level. We follow two simple rules to generate more dynamic times.
1) The levels below the level at which the dynamic time is specified are used to further refine the time being specified. For instance, if the dynamic time is ThisMonth, then if the Day value is 3 it is considered as the 3rd day of this month. If it is -3 it is considered as the 3rd last day of the month.
2) The levels at and above are considered as offsets to the time obtained by putting together the lower levels. For example, if the dynamic time is ThisMonth and the Year value is +2, then we are referring to this month two years hence. If it is -1, then it is last year this month.
Note that, when the month and DayOfWeek values are used as offsets i.e. the DynamicTime is at or below this level, the corrresponding numeric values are taken as the offsets.
We have the following examples:
  • Last Day of Last Month: DynamicTime is DssTimeThisMonth. Month property is -1, Day property is -1.
  • 3rd Sunday of Last Month: DynamicTime is DssTimeThisMonth. Month property is -1, Week property is 3 and DayOfWeek is Sunday.
  • 3 years, 2 months and 3 days ago: DynamicTime is DssTimeToday, Year is -3, Month is -2, Day is -3.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Format [in] BSTR  Format,
[in, defaultvalue(-1)] Int32  Locale,
[out, retval] BSTR *  oOutputString
 

The format of the date and/or time (Format) is a string pattern, with substitutable placeholders defined as follows.

The pattern is case-insensitive expect for the cases of "AM/PM", "am/pm", "a/p", "A/P". In these situations, the format specifier i.e. "AM" etc. is returned with the string, hence we do not change the case. In all other situations, the case does not matter.

  • d Day of the month in one or two numeric digits, as needed (1 to 31).
  • dd Day of the month in two numeric digits (01 to 31).
  • ddd First three letters of the weekday (Sun to Sat).
  • dddd Full name of the weekday (Sunday to Saturday).
  • ddddd Use the Short Date predefined format, defined in Control Panel/Regional Setting.
  • dddddd Use the Long Date predefined format, defined in Control Panel/Regional Setting.
  • w Day of the week (1 for Sunday through 7 for Saturday).
  • ww Week of the year (1 to 53).
  • m Month of the year in one or two numeric digits, as needed (1 to 12).
  • mm Month of the year in two numeric digits (01 to 12).
  • mmm First three letters of the month (Jan to Dec).
  • mmmm Full name of the month (January to December).
  • q Date displayed as the quarter of the year (1 to 4).
  • y Number of the day of the year (1 to 366).
  • yy Last two digits of the year (01 to 99).
  • yyyy Full year (0100 to 9999).
  • h Hour in one or two digits, as needed (0 to 23).
  • hh Hour in two digits (00 to 23).
  • n Minute in one or two digits, as needed (0 to 59).
  • nn Minute in two digits (00 to 59).
  • s Second in one or two digits, as needed (0 to 59).
  • ss Second in two digits (00 to 59).
  • AM/PM Twelve-hour clock with the uppercase letters AM or PM, as appropriate.
  • am/pm Twelve-hour clock with the lowercase letters am or pm, as appropriate.
  • A/P Twelve-hour clock with the uppercase letter A or P, as appropriate.
  • a/p Twelve-hour clock with the lowercase letter a or p, as appropriate.
  • AMPM Twelve-hour clock with the appropriate morning/afternoon designator as defined in the Regional Settings Properties dialog box in Windows Control Panel.
    Examples of the affect of different formats.
    Format Display
    m/dd/yy 12/07/97
    d-mmmm-yy 7-December-97
    mmm d Dec 7
    h:nn:ss AM/PM 2:34:05 PM
    Sample default format in different databases:
    Database Date Format
    Oracle dd-mmm-yy
    DB2 yyyy-mm-dd
    Informix Date(mm/dd/yyyy)
    Tandem {d'yyyy-mm-dd}
    Parameters:
    Format Format of the date output.
    Locale Optional local specification.
    oOutputString Return the formatted time value.
    Returns:
    Usual COM result code:
  • S_OK

HRESULT IDSSTime::GetNthTimePointBefore [in] Int32  n,
[in] EnumDSSTimeGranularityLevel  Level,
[out, retval] IDSSTime   ppTime
 

Get an absolute time a integer number of time units before this time.

EnumDSSGranularityLevel can have the values DssGranularityMilliseconds, DssGranularitySeconds, DssGranularityMinutes, DssGranularityHour, DssGranularityDay, DssGranularityMonth, DssGranularityYear, DssGranularityWeek, DssGranularityDayofweek.

Parameters:
n Give the nth time point before. -ve numbers give time points after a given time point.
Level A new time point which is shifted by N units at the given granularity level is returned. A granularity of a day would mean the same time point n days before. Similarly, a granularity level of year will return the Time shifted back by n years.
ppTime Return the time value.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::GetShift [in] Int32  level,
[out, retval] Int32 *  pShift
 

This method is applicable only for dynamic time points.

It returns the shift at a particular for a dynamic point. For example, 3 days back can be represented as a dynamic time as today shifted by 3 days backwards. The shift method at the level of day would return -3.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Hour [in] Int32  Hour  ) 
 

If IsGmt is TRUE (non-zero), then the Hour corresponds to time according to GMT.

If not, it is according to the local time.

Let us consider non-dynamic times (i.e. not DssTimeNow, or DssTimeToday). Obviously, there are four different combinations of the Mode and the IsGmt flag. The most intuitive one is the Mode being DssTimeModeLocaleSensitive and IsGmt being false.with these settings, any get method gives the time according to the local time zone. As an example consider the time 12.00 according to Pacific Standard Time on a certain day. With the above settings the hour returned in the Pacific standard time zone would be 12.00, whereas on the West coast would be 9.00. If the IsGmt setting is TRUE instead, the time returned would be in GMT. Thus at both the places the time returned will be 5.00 (assuming no daylight savings time). If the Mode is DssTimeModeLocaleInsensitive and the flag is FALSE, then the time returned at both the places would be 12.00 (it does not change with time zone). But if the Mode if DssTimeModeLocaleInsensitive and IsGmt is TRUE, then the hour returned would be 17.00 (12.00 + 5.00) in the Pacific region and 20.00 (12.00 + 8.00) on the West Coast.
The same rules apply for all other properties such as Year, Month etc. and then the appropriate data field is extracted.
If the time is NOW, the current time according to the current time zone is
Parameters:
Hour 12 AM is 0, 1 AM is 1 and so on till 11 PM which is 23.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Hour [out, retval] Int32 *  pHour  ) 
 

If IsGmt is TRUE (non-zero), then the Hour corresponds to time according to GMT.

If not, it is according to the local time.

Let us consider non-dynamic times (i.e. not DssTimeNow, or DssTimeToday). Obviously, there are four different combinations of the Mode and the IsGmt flag. The most intuitive one is the Mode being DssTimeModeLocaleSensitive and IsGmt being false.with these settings, any get method gives the time according to the local time zone. As an example consider the time 12.00 according to Pacific Standard Time on a certain day. With the above settings the hour returned in the Pacific standard time zone would be 12.00, whereas on the West coast would be 9.00. If the IsGmt setting is TRUE instead, the time returned would be in GMT. Thus at both the places the time returned will be 5.00 (assuming no daylight savings time). If the Mode is DssTimeModeLocaleInsensitive and the flag is FALSE, then the time returned at both the places would be 12.00 (it does not change with time zone). But if the Mode if DssTimeModeLocaleInsensitive and IsGmt is TRUE, then the hour returned would be 17.00 (12.00 + 5.00) in the Pacific region and 20.00 (12.00 + 8.00) on the West Coast.
The same rules apply for all other properties such as Year, Month etc. and then the appropriate data field is extracted.
If the time is NOW, the current time according to the current time zone is
Parameters:
pHour 12 AM is 0, 1 AM is 1 and so on till 11 PM which is 23.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Init  ) 
 

This method should be called before any get property or method is called.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::IsEqualTo [in] IDSSTime pTime,
[out, retval] VARIANT_BOOL *  pBool
 

Returns true if both the time points represent the same point of time.

If not returns false. One or both of them can be dynamic.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::IsGmt [in] VARIANT_BOOL  IsGmt  ) 
 

The IsGmt flag being a VARIANT_BOOL can be TRUE or FALSE.

The most intuitive setting is FALSE and will be the default. The IsGmt flag is just used to view a given time point according to the local time zone representation or GMT representation. The Mode flag on the other hand actually alters the nature of the time point. This is provided because, GMT is a special time zone and a user might want to see the time in this representation. Thus, when the flag is FALSE, the time is given out in the local time zone representation. A get_hour when the flag is FALSE returns the hour of the time point's representation in the local time zone. When the IsGmt flag is TRUE, the hour returned is from the represenation of the same time point in the GMT zone.

For examples on usage of the two flags, please see the under Hour.
Returns:
Usual COM result code:

HRESULT IDSSTime::IsGmt [out, retval] VARIANT_BOOL *  pIsGmt  ) 
 

The IsGmt flag being a VARIANT_BOOL can be TRUE or FALSE.

The most intuitive setting is FALSE and will be the default. The IsGmt flag is just used to view a given time point according to the local time zone representation or GMT representation. The Mode flag on the other hand actually alters the nature of the time point. This is provided because, GMT is a special time zone and a user might want to see the time in this representation. Thus, when the flag is FALSE, the time is given out in the local time zone representation. A get_hour when the flag is FALSE returns the hour of the time point's representation in the local time zone. When the IsGmt flag is TRUE, the hour returned is from the represenation of the same time point in the GMT zone.

For examples on usage of the two flags, please see the under Hour.
Returns:
Usual COM result code:

HRESULT IDSSTime::IsGreaterThan [in] IDSSTime pTime,
[out, retval] VARIANT_BOOL *  pBool
 

Returns true if the time represented by the current time point is after the time point represented by the time point passed.

If not returns false. One or both of them can be dynamic.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::IsLessThan [in] IDSSTime pTime,
[out, retval] VARIANT_BOOL *  pBool
 

Returns true if the time represented by the current time point is before the time point represented by the time point passed.

If not returns false. One or both of them can be dynamic.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::MilliSeconds [in] Int32  MilliSeconds  ) 
 

If IsGmt is TRUE (non-zero), then the MilliSeconds correspond to time according to GMT.

If not, they are according to the local time.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::MilliSeconds [out, retval] Int32 *  pMilliSeconds  ) 
 

If IsGmt is TRUE (non-zero), then the MilliSeconds correspond to time according to GMT.

If not, they are according to the local time.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Minutes [in] Int32  Minutes  ) 
 

If IsGmt is TRUE (non-zero), then the Minutes correspond to time according to GMT.

If not, they are according to the local time.

This property should be ignored for dynamic times representing days (TODAY etc.).
See comments on property Hour.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Minutes [out, retval] Int32 *  pMinutes  ) 
 

If IsGmt is TRUE (non-zero), then the Minutes correspond to time according to GMT.

If not, they are according to the local time.

This property should be ignored for dynamic times representing days (TODAY etc.).
See comments on property Hour.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Mode [in] EnumDSSDateTimeMode  Mode  ) 
 

Mode that determines the nature of the time point.

We provide time zone independence through this property. Right now Mode can be DssTimeModeLocaleSensitive or DssTimeModeLocaleInsensitive. DssTimeModeLocaleSensitive is the Mode that we expect will be used most and is most intuitive. When in this mode, time is be stored in GMT (though how they are stored is an implementation detail, it makes this explanation easier to understand) and is converted according to the local time zone of the place where the get_xxx methods are invoked. Thus, if we are on the East Coast of the US (Eastern Time which is 5.00 hrs behind GMT, ignoring daylight savings time) and we set the time to be 3.00 PM on a certain day, it is stored as 8.00 PM. When the get_xxx methods are invoked on the Western coast of the US, this time is converted to their time zone (which is 8.00hrs behind) and is equivalent to 12.00PM. Thus in this Mode, the IDSSTime interface represent a point of time which does not change with time zone i.e. the same instant of time across all time zones. We call this an Absolute Time Point.

On the other hand, we may want to do something at 5.00 PM (like taking a look at the stock market before leaving work) everyday whatever the time zone be. So we do not want this time to be influenced by changing time zones. This can be done by setting the Mode flag to DssTimeModeLocaleInsensitive. Thus, though numerically it is the same time, it refers to different Absolute Time Points.
The Default value for the Mode is DssTimeModeLocaleInsensitive. Unless set to a different value the mode flag will be set to this.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Mode [out, retval] EnumDSSDateTimeMode pMode  ) 
 

Mode that determines the nature of the time point.

We provide time zone independence through this property. Right now Mode can be DssTimeModeLocaleSensitive or DssTimeModeLocaleInsensitive. DssTimeModeLocaleSensitive is the Mode that we expect will be used most and is most intuitive. When in this mode, time is be stored in GMT (though how they are stored is an implementation detail, it makes this explanation easier to understand) and is converted according to the local time zone of the place where the get_xxx methods are invoked. Thus, if we are on the East Coast of the US (Eastern Time which is 5.00 hrs behind GMT, ignoring daylight savings time) and we set the time to be 3.00 PM on a certain day, it is stored as 8.00 PM. When the get_xxx methods are invoked on the Western coast of the US, this time is converted to their time zone (which is 8.00hrs behind) and is equivalent to 12.00PM. Thus in this Mode, the IDSSTime interface represent a point of time which does not change with time zone i.e. the same instant of time across all time zones. We call this an Absolute Time Point.

On the other hand, we may want to do something at 5.00 PM (like taking a look at the stock market before leaving work) everyday whatever the time zone be. So we do not want this time to be influenced by changing time zones. This can be done by setting the Mode flag to DssTimeModeLocaleInsensitive. Thus, though numerically it is the same time, it refers to different Absolute Time Points.
The Default value for the Mode is DssTimeModeLocaleInsensitive. Unless set to a different value the mode flag will be set to this.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Month [in] EnumDSSMonth  Month  ) 
 

If IsGmt is TRUE (non-zero), then the Month corresponds to time according to GMT.

If not, it is according to the local time.

Though the input is long, values from the enumeration EnumDSSMonth = {DssJanuary, DssFebruary, DssMarch, DssApril, DssMay and so on...} can be supplied.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Month [out, retval] EnumDSSMonth pMonth  ) 
 

If IsGmt is TRUE (non-zero), then the Month corresponds to time according to GMT.

If not, it is according to the local time.

Though the input is long, values from the enumeration EnumDSSMonth = {DssJanuary, DssFebruary, DssMarch, DssApril, DssMay and so on...} can be supplied.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Name [in] BSTR  Name  ) 
 

Stores a name for this time point.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Name [out, retval] BSTR *  pName  ) 
 

Stores a name for this time point.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::PopulateDefn [in] IDSSTime pTime  ) 
 

Populate the current time point using the time point passed.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Seconds [in] Int32  pSeconds  ) 
 

If IsGmt is TRUE (non-zero), then the Seconds correspond to time according to GMT.

If not, they are according to the local time.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Seconds [out, retval] Int32 *  pSeconds  ) 
 

If IsGmt is TRUE (non-zero), then the Seconds correspond to time according to GMT.

If not, they are according to the local time.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Shift [in] IDSSTimePeriod pTimePeriod,
[out, retval] IDSSTime   pTime
 

Shift the current time point by the amount of time represented by the Time Period object.

Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Text [in] BSTR  Text,
[in, defaultvalue(-1)] Int32  Locale
 

The time point is computed from a given string.

Parameters:
Text The string that we want to convert to a date.
Locale The locale to use for the conversion. Use -1 for current system locale.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Week [in] Int32  MonthWeek  ) 
 

If IsGmt is TRUE (non-zero), then the DayOfWeek corresponds to time according to GMT.

If not, it is according to the local time.

Instead of long values, the enumeration EnumDSSDayOfWeek ={DssSunday, DssMonday, DssTueday, ...}can be used.
Note that, Day should not be set if Week and DayOfWeek are set.
Returns:
Usual COM result code:
  • S_OK
  • S_OK

HRESULT IDSSTime::Week [out, retval] Int32 *  pMonthWeek  ) 
 

If IsGmt is TRUE (non-zero), then the DayOfWeek corresponds to time according to GMT.

If not, it is according to the local time.

Instead of long values, the enumeration EnumDSSDayOfWeek ={DssSunday, DssMonday, DssTueday, ...}can be used.
Note that, Day should not be set if Week and DayOfWeek are set.
Returns:
Usual COM result code:
  • S_OK
  • S_OK

HRESULT IDSSTime::Year [in] Int32  Year  ) 
 

If IsGmt is TRUE (non-zero), then the Year corresponds to time according to GMT.

If not, it is according to the local time.

It should be noted that the year supplied is taken as it is. For example, if 98 is supplied, it is taken as 98 A.D and not 1998 or 2098.
In case of a get property on a dynamic time such as DssTimeThisYear, the Mode flag and IsGmt flag are ignored. Also see comments on property Hour.
Returns:
Usual COM result code:
  • S_OK

HRESULT IDSSTime::Year [out, retval] Int32 *  pYear  ) 
 

If IsGmt is TRUE (non-zero), then the Year corresponds to time according to GMT.

If not, it is according to the local time.

It should be noted that the year supplied is taken as it is. For example, if 98 is supplied, it is taken as 98 A.D and not 1998 or 2098.
In case of a get property on a dynamic time such as DssTimeThisYear, the Mode flag and IsGmt flag are ignored. Also see comments on property Hour.
Returns:
Usual COM result code:
  • S_OK


Copyright © 1996-2018 MicroStrategy Inc. All Rights Reserved.