Date Compression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ktg024
    New Member
    • May 2007
    • 21

    Date Compression

    Hi All,

    How can i Convert or compress the time(e.g 23:10:23 ) into single byte.

    i am in knife edge plz........... help me.......

    Thanks in advance :)
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    No can do. There are not enough bits in a byte to do this.

    You need:
    1) 5 bits for the hour
    2) 6 bits for the minutes
    3) 6 bits for the seconds

    There are only 8 bits in a byte. That is, regardless of your compression technique, a byte can hold only 256 combonations.

    Comment

    • JosAH
      Recognized Expert MVP
      • Mar 2007
      • 11453

      #3
      Even if you use something better than 6:6:5 bits there are still 60x24 == 1440
      minutes in a 24 hour day and a byte still can't store them all. Maybe if you want
      to lose a bit of resolution you can store a day worth of minutes using a ~6 minute
      granularity.

      kind regards,

      Jos

      Comment

      Working...