(Read-only.) The PROPID_M_SENTTIME property indicates the date and time when the message was sent by the source queue manager.
The PROPID_M_SENTTIME property is attached to the message by Message Queuing. The time returned is the number of seconds elapsed since midnight (00:00:00), January 1, 1970 (Coordinated Universal Time) according to the system clock.
To see when a message was sent, specify PROPID_M_SENTTIME in the MQMSGPROPS structure. Then call MQReceiveMessage or MQReceiveMessageByLookupId and examine the returned value. The type indicator of this property can be set to VT_UI4 or VT_NULL. If you set the type indicator to VT_NULL, Message Queuing automatically changes the type indicator to VT_UI4 during the function call.
Microsoft provides several time functions that can be used to manipulate the returned Coordinated Universal time value. These functions are defined in the time.h header file.
Equivalent COM Property
With COM components, the equivalent property for retrieving the time when a message was sent is MSMQMessage.SentTime.
The following code fragment shows how PROPID_M_SENTTIME is specified in arrays that can be used to initialize an MQMSGPROPS structure.
aMsgPropId[i] = PROPID_M_SENTTIME; // Property ID aMsgPropVar[i].vt = VT_NULL; // Type indicator i++;
The following example is included in Using Message Queuing.
|For an example of||See|
Filtering messages based on the time they were sent to the queue