File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -131,11 +131,17 @@ public bool Capture(
131131 GroupCollection ? groups ,
132132 bool sendFeatureFlags )
133133 {
134+ // Check for custom timestamp in properties
135+ var timestamp = properties ? . TryGetValue ( "timestamp" , out var timestampValue ) == true &&
136+ ( timestampValue is DateTimeOffset customTimestampOffset || timestampValue is DateTime customTimestamp )
137+ ? timestampValue is DateTimeOffset dtOffset ? dtOffset : new DateTimeOffset ( ( DateTime ) timestampValue )
138+ : _timeProvider . GetUtcNow ( ) ;
139+
134140 var capturedEvent = new CapturedEvent (
135141 eventName ,
136142 distinctId ,
137143 properties ,
138- timestamp : _timeProvider . GetUtcNow ( ) ) ;
144+ timestamp : timestamp ) ;
139145
140146 if ( groups is { Count : > 0 } )
141147 {
You can’t perform that action at this time.
0 commit comments