Export (0) Print
Expand All

How to: Use Relative Time to Access Free/Busy Data

Last modified: October 26, 2010

Applies to: Office 2007 | Office 2010 | Outlook 2010

The IFreeBusyData interface in the Free/Busy API uses a concept of relative time, which is the number of minutes since January 1, 1601, expressed in Universal Time (UTC), and is a value of type LONG.

The following are some commonly used relative time values:

  • ULONG ulrtmMax = 1525252319L

  • ULONG ulrtmMin = 0L

Use the preceding maximum and minimum relative time values to help verify that your relative time values are valid.

Because NTFS records file times natively in FILETIME format, it might be handy to use the following code example to convert relative time to and from FILETIME.

static const LONGLONG UnitsPerMinute = 600000000; 
static const LONGLONG UnitsPerHalfMinute = 300000000; 
void RTimeToFileTime(LONG rtime, FILETIME *pft) 
{ 
    Assert(pft != NULL); 
    ULARGE_INTEGER *puli = (ULARGE_INTEGER *)pft; 
    puli->QuadPart = rtime * UnitsPerMinute; 
} 
  
void FileTimeToRTime(FILETIME *pft, LONG* prtime) 
{ 
    Assert(pft != NULL); 
    Assert(prtime != NULL); 
 
    ULARGE_INTEGER uli = *(ULARGE_INTEGER *)pft; 
  
    uli.QuadPart += UnitsPerHalfMinute; 
    uli.QuadPart /= UnitsPerMinute; 
    *prtime = uli.LowPart; 
} 


Show:
© 2014 Microsoft