LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert unsigned bytes (U8) to time date stamp.

Solved!
Go to solution

From a CAN device I have the date and time as a series of seven unsigned bytes (U8) as follows:

 

Century         example        20

Year              example       10

Month           example         4

Day              example        26

Hour             example       20   (8:00 PM)

Min               example       20

Sec               example         1

 

which would be:

            4/26/2010

            20:20:1

 

What is the best approach to convertng these seven values to a date/time format for display purposes only?

 

Thank you.

0 Kudos
Message 1 of 4
(2,766 Views)
Solution
Accepted by topic author chuck72352

Chuck,

 

Here's a couple of ways to do it, but sure there are others.

The first for numeric inputs or concatenate to a string with second.

create timestamp.png

 

 

Hope one of these does what you need.

 

*Edit - added combining or Century & Year

Message Edited by jrjones on 04-25-2010 10:40 PM
LabVIEW 5.0 seems so long ago...
Message 2 of 4
(2,761 Views)

Your century/year manipulations are incorrect.  The result of 20 and 10 gives you 5130.  Maybe its a time machine.

 

What you need to do is basic math, multiply the century number by 100 and add the year.

Message 3 of 4
(2,755 Views)

Raven,

 

You are correct, that combination is just WRONG.

Thanks for the catch....

I guess it's time to go to bed; I'm not paying attention to what I'm doing.

LabVIEW 5.0 seems so long ago...
0 Kudos
Message 4 of 4
(2,750 Views)