LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Decimal to Hex conversion

This sounds like your asking the wrong question... Your asking "How do I do X" when you should be asking "I want to do Y"

Back up and tell us what you want to do not how you are doing it.

Just a guess, but sounds like you want to store/save a time stamp to a file.

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 11 of 39
(1,680 Views)

@deep_217 wrote:

its YYMMDDHHMM big


Yes, about 5 cm on my screen...

 

Where does this come from? Why are you asking about hex conversion and when it's about time.

 

This does fit a simple timestamp...  Or a double. Or an extended. Or after conversion an I64 or U64...

0 Kudos
Message 12 of 39
(1,678 Views)

@deep_217 wrote:

Its a date and time string with hour and minute... not too big but larger then 32bit because year changed to 2022 so instead of 21 we have to use 22 YYMMDDHHMM 



Just use format timestamp with a specifier of

%T<%y%m%D%H%M>

Time as (%t is local specific time)

Year of century 00-99 %Y is year with plenty of available digits unless the universe never collapses ( a terrible description n00 is the last year of century n-1)

Month 1-12

Day of month 1-32 (there is a non-existent 12/32 at epoch)

Hour 0-24 (%h is 0-12 but you don't spec a meridian flag)

Minute 0-60


"Should be" isn't "Is" -Jay
Message 13 of 39
(1,663 Views)

I think a "post what you have" is loooong overdue...

 

So... Post what you have.

0 Kudos
Message 14 of 39
(1,656 Views)

@deep_217 wrote:

its YYMMDDHHMM big


It is exactly 10 bytes.

 

Small for all practical purposes. Most likely you can fit a hundred million of those strings in memory. 😄 

 

If you want to "compress" this string into a single integer suitable for hex formatting, you can take advantage of the fact that MM are limited to 0..59, HH to 0 .23, DD is limited to 1..31, MM is limited to 1..12. Of course you also need something to convert the hex string back to the date string. 

0 Kudos
Message 15 of 39
(1,647 Views)

Please find the attached VI which works for a date from 2021 because number to hex converter does not accept a number bigger than 2147483647 because its upper limit of 32bit integer.

0 Kudos
Message 16 of 39
(1,618 Views)

You need to wire a U64 diagram constant to the default value input of "format into string" to define the desired non-I32 data type.

 

(Posting by phone, cannot see your vi)

Message 17 of 39
(1,595 Views)

I must say that this is the weirdest format for a timestamp I have ever seen.  What is driving this format?  What is wrong with just using the result from the Format Date/Time String?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 18 of 39
(1,585 Views)

@crossrulz wrote:

 What is driving this format? 


 

My wild guess is that it'll be part of file (or folder) name. (Chronologic and alphabetic sorting would be the same)

0 Kudos
Message 19 of 39
(1,577 Views)

@altenbach wrote:

@crossrulz wrote:

 What is driving this format? 


 

My wild guess is that it'll be part of file (or folder) name. (Chronologic and alphabetic sorting would be the same)


But you would still have the Chronologic and Alphabetic sorting match with the YYMMDDHHMM format.  Which is what is making me scratch my head as it just looks like somebody is trying to make things more secure through obscurity (which is not really secure).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 20 of 39
(1,568 Views)