FSEvents.LastEventIdForDeviceBeforeTime
---------------------------------------

Queries event ID for a given time on a device.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [FSEvents](component_FSEvents.md) | [6.0](newinversion60.md) | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ❌ No |

MBS( "FSEvents.LastEventIdForDeviceBeforeTime"; Path; TimeStamp ) 

**MBS**( **"FSEvents.LastEventIdForDeviceBeforeTime";** /\* Queries event ID for a given time on a device. \*/  
**$Path**; /\* The path to the disk.e.g. "/" \*/   
**$TimeStamp**) /\* The timestamp to use. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Path | The path to the disk. | "/" |
| TimeStamp | The timestamp to use. |  |

### Result

Returns ID or error.

### Description

Queries event ID for a given time on a device.  
Gets the last event ID for the given device that was returned before the given time. This is conservative in the sense that if you then use the returned event ID as the sinceWhen parameter of [FSEvents.CreateRelativeToDevice](FSEventsCreateRelativeToDevice.md) that you will not miss any events that happened since that time. On the other hand, you might receive some (harmless) extra events.   
Beware: there are things that can cause this to fail to be accurate. For example, someone might change the system's clock (either backwards or forwards). Or an external drive might be used on different systems without perfectly synchronized clocks.  
### Examples

Queries event ID for root device:

 MBS ( "FSEvents.LastEventIdForDeviceBeforeTime"; "/"; Date( 1 ; 1 ; 2015 ) )  
### See also

- [FSEvents.Create](FSEventsCreate.md)
- [FSEvents.CreateRelativeToDevice](FSEventsCreateRelativeToDevice.md)

This function checks for a license.

Created 29th November 2015 , last changed 12nd August 2017

  
[FSEvents.HasNextEvent](FSEventsHasNextEvent.md) - [FSEvents.LatestEventId](FSEventsLatestEventId.md)

[HTML Version](FSEventsLastEventIdForDeviceBeforeTime.shtml)