[**RongIMLib**](../../../../README.md) *** [RongIMLib](../../../../globals.md) / [electronExtension](../README.md) / getMessagesAroundTimestamp # Function: getMessagesAroundTimestamp() > **getMessagesAroundTimestamp**(`conversation`, `option`): `Promise`\<[`RCResult`](../../../../interfaces/RCResult.md)\<[`IAReceivedMessage`](../../../../interfaces/IAReceivedMessage.md)[]\>\> 获取本地指定时间戳前后 N 条消息方法 ## Parameters ### conversation [`IConversationIdentifier`](../../../../interfaces/IConversationIdentifier.md) 会话信息 ### option 获取参数 #### timestamp `number` #### beforeCount `number` #### afterCount `number` ## Returns `Promise`\<[`RCResult`](../../../../interfaces/RCResult.md)\<[`IAReceivedMessage`](../../../../interfaces/IAReceivedMessage.md)[]\>\> ## Description 本接口仅适用 Electron 平台,获取本地指定时间戳前后 N 条消息 ## Since 5.9.8 ## Example 获取本地指定时间戳前后 N 条消息示例: ```ts const conversation = { conversationType: RongIMLib.ConversationType.PRIVATE, targetId: 'targetId', }; const option = { timestamp: 0, beforeCount: 10, afterCount: 10, }; const res = await RongIMLib.electronExtension.getMessagesAroundTimestamp(conversation, option); console.info('获取本地指定时间戳前后 N 条消息结果:', res); ```