Alex Rivera | Logout

What is the smallest number of bytes that can store a timestamp?

Asked 2009-02-27T18:02:57.447
17

I want to create my own time stamp data structure in C.

DAY ( 0 - 30 ), HOUR ( 0 - 23 ), MINUTE ( 0 - 59 )

What is the smallest data structure possible?

Edit
Report

1 Answer

2

For the use case you describe, (minute resolution of times in a 31 day range) I'd just use a 16-bit minute counter. If you're serializing this data (to disk, network) then you can use some variable length integer encoding to save bytes for small values.

answered 2009-02-27T18:15:29.413

Your Answer