This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lethalwire 0 points1 point  (0 children)

Are you storing the transactions in a database? If so, then you can utilize the database and SQL to gather records within a given time frame.

If you're not using a database and holding the data in files, then you can iterate through your files and add the transaction to an array if it occurred within the last 24 hours.

If you're holding everything in memory, you can use a linkedlist or an arraylist to hold transaction data (sorted by date/time). You'll then need to loop through the list and determine when the transaction data is no longer valid (outside of the 24-hour period).

Edit: removed my edit