@@ -80,6 +80,24 @@ omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1.fields.auction_response_index = P
8080omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .fields .leg_information_index = ProtoField .new (" Leg Information Index" , " nasdaq.iseoptions.ordercombofeed.itch.v1.1.leginformationindex" , ftypes .UINT16 )
8181omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .fields .message_index = ProtoField .new (" Message Index" , " nasdaq.iseoptions.ordercombofeed.itch.v1.1.messageindex" , ftypes .UINT16 )
8282
83+ ---- -------------------------------------------------------------------
84+ -- Nasdaq IseOptions OrderComboFeed Itch 1.1 Formatting
85+ ---- -------------------------------------------------------------------
86+
87+ -- timestamp format
88+ local timestamp_format_enum = {
89+ { 1 , " Raw" , 0 },
90+ { 2 , " Time of Day" , 1 },
91+ { 3 , " Full DateTime" , 2 }
92+ }
93+
94+ -- 0=Raw, 1=TimeOfDay, 2=FullDateTime
95+ nasdaq_iseoptions_ordercombofeed_itch_v1_1 .timestamp_format = 2
96+
97+ -- Hours behind UTC (EST) for midnight calculation
98+ nasdaq_iseoptions_ordercombofeed_itch_v1_1 .utc_offset_hours = 5
99+
100+
83101---- -------------------------------------------------------------------
84102-- Declare Dissection Options
85103---- -------------------------------------------------------------------
@@ -110,6 +128,8 @@ omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1.prefs.show_message_index = Pref.b
110128omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .prefs .show_leg_information_index = Pref .bool (" Show Leg Information Index" , show .leg_information_index , " Show generated leg information index in protocol tree" )
111129omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .prefs .show_auction_response_index = Pref .bool (" Show Auction Response Index" , show .auction_response_index , " Show generated auction response index in protocol tree" )
112130
131+ omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .prefs .timestamp_format = Pref .enum (" Timestamp Format" , 2 , " Timestamp display format" , timestamp_format_enum , false )
132+ omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .prefs .utc_offset_hours = Pref .uint (" UTC Offset (hours)" , 5 , " Hours behind UTC (EST) for midnight calculation" )
113133
114134-- Handle changed preferences
115135function omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .prefs_changed ()
@@ -145,6 +165,12 @@ function omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1.prefs_changed()
145165 if show .auction_response_index ~= omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .prefs .show_auction_response_index then
146166 show .auction_response_index = omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .prefs .show_auction_response_index
147167 end
168+ if nasdaq_iseoptions_ordercombofeed_itch_v1_1 .timestamp_format ~= omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .prefs .timestamp_format then
169+ nasdaq_iseoptions_ordercombofeed_itch_v1_1 .timestamp_format = omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .prefs .timestamp_format
170+ end
171+ if nasdaq_iseoptions_ordercombofeed_itch_v1_1 .utc_offset_hours ~= omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .prefs .utc_offset_hours then
172+ nasdaq_iseoptions_ordercombofeed_itch_v1_1 .utc_offset_hours = omi_nasdaq_iseoptions_ordercombofeed_itch_v1_1 .prefs .utc_offset_hours
173+ end
148174end
149175
150176
@@ -1359,8 +1385,28 @@ nasdaq_iseoptions_ordercombofeed_itch_v1_1.timestamp = {}
13591385nasdaq_iseoptions_ordercombofeed_itch_v1_1 .timestamp .size = 6
13601386
13611387-- Display: Timestamp
1362- nasdaq_iseoptions_ordercombofeed_itch_v1_1 .timestamp .display = function (value )
1363- return " Timestamp: " .. value
1388+ nasdaq_iseoptions_ordercombofeed_itch_v1_1 .timestamp .display = function (value , buffer , offset , packet , parent )
1389+ -- Raw display mode
1390+ if nasdaq_iseoptions_ordercombofeed_itch_v1_1 .timestamp_format == 0 then
1391+ return " Timestamp: " .. value
1392+ end
1393+
1394+ -- Parse nanoseconds since midnight
1395+ local seconds = (value / UInt64 (1000000000 )):tonumber ()
1396+ local nanoseconds = (value % UInt64 (1000000000 )):tonumber ()
1397+
1398+ -- Full datetime mode (calculate from capture date + UTC offset)
1399+ if nasdaq_iseoptions_ordercombofeed_itch_v1_1 .timestamp_format == 2 and packet then
1400+ local capture_time = type (packet .abs_ts ) == " number" and packet .abs_ts or packet .abs_ts :tonumber ()
1401+ local utc_offset_seconds = nasdaq_iseoptions_ordercombofeed_itch_v1_1 .utc_offset_hours * 3600
1402+ local local_midnight = math.floor ((capture_time - utc_offset_seconds ) / 86400 ) * 86400 + utc_offset_seconds
1403+ local full_seconds = local_midnight + seconds
1404+
1405+ return " Timestamp: " .. os.date (" %Y-%m-%d %H:%M:%S." , full_seconds ).. string.format (" %09d" , nanoseconds )
1406+ end
1407+
1408+ -- Time of day mode
1409+ return " Timestamp: " .. os.date (" %H:%M:%S." , seconds ).. string.format (" %09d" , nanoseconds )
13641410end
13651411
13661412-- Dissect: Timestamp
0 commit comments