pravin Posted September 4, 2014 Report Share Posted September 4, 2014 Hi All, I want to decode a HEX time into System time and need a conversion factor for the same. The HEX time stamp is : 0F2E3B2D The approx system time is : 12:29:44.419 PM Thanks Pravin Quote Link to comment
hooovahh Posted September 4, 2014 Report Share Posted September 4, 2014 More information is needed. What is the units of the HEX time stamp? Is it seconds? Milliseconds? Minutes? Hours? Days? And what is the date of your time? Are you saying that the hex value starts 0 at midnight? and by just after noon you have over 254 million units of time? A pretty quick and dirty way of making this work is to find the difference between the hex input, and the known input you have there, then add or subtract that amount of time from the known time stamp you have there. Quote Link to comment
ThomasGutzler Posted September 5, 2014 Report Share Posted September 5, 2014 (edited) And I thought Internet Time was the coolest thing... @139.beats Edited September 5, 2014 by ThomasGutzler Quote Link to comment
pravin Posted September 5, 2014 Author Report Share Posted September 5, 2014 The HEX time is in milliseconds and the day of my time was 4 sept 2014. This is actually a responce from a controller and if i subtract two values i get difference in milliseconds. Hope it will be usefull regards Pravin Quote Link to comment
JKSH Posted September 5, 2014 Report Share Posted September 5, 2014 The HEX time is in milliseconds and the day of my time was 4 sept 2014. This is actually a responce from a controller and if i subtract two values i get difference in milliseconds. Milliseconds relative to what? Relative to the time when the controller started running? Relative to midnight of 1 January 1970? Something else? 0x0F2E3B2D is 254688045 in decimal. 254688045 milliseconds is about 8.8 hours. Had your controller been running for 8.8 hours when you captured that timestamp? Quote Link to comment
Rolf Kalbermatter Posted September 5, 2014 Report Share Posted September 5, 2014 The HEX time is in milliseconds and the day of my time was 4 sept 2014. This is actually a responce from a controller and if i subtract two values i get difference in milliseconds. Hope it will be usefull regards Pravin Your Hex time is a so called timer tick time. Its counter starts at boot up of the system (or any other time your embedded system likes) and simply counts through, wrapping around after 0xFFFFFFFF (or 2^32 = ~4 billion) ms = ~ 4 million seconds = ~50 days. As such there is absolutely no good way to convert this into an absolute timestamp since its reference time (the 0 point) will be defined new every 50 days or so, or whenever you startup/reset your system. Your value indicates that your system was probably up and running for around 254688 seconds = ~3 days since last booted/reset. 0x0F2E3B2D is 254688045 in decimal. 254688045 milliseconds is about 8.8 hours. A day has 86400 seconds, so 254688 seconds certainly is more than 8.8 hours. Quote Link to comment
JKSH Posted September 5, 2014 Report Share Posted September 5, 2014 A day has 86400 seconds, so 254688 seconds certainly is more than 8.8 hours. Oops, I misread Wolfram Alpha. You're right, 254688 seconds is almost 3 days. Quote Link to comment
Rolf Kalbermatter Posted September 5, 2014 Report Share Posted September 5, 2014 Oops, I misread Wolfram Alpha. You're right, 254688 seconds is almost 3 days. I see! You let your embedded devices have a normal 8 hour working day and interpret the number of working days as hours! Quote Link to comment
JKSH Posted September 6, 2014 Report Share Posted September 6, 2014 I see! You let your embedded devices have a normal 8 hour working day and interpret the number of working days as hours! So that they don't burn out from overwork, and so that I can pay less wages P.S. For humans, I endorse the former, not the latter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.