04-01-2022 09:51 AM
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.
04-01-2022 09:58 AM
@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...
04-01-2022 11:12 AM - edited 04-01-2022 11:28 AM
@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
04-01-2022 11:30 AM
I think a "post what you have" is loooong overdue...
So... Post what you have.
04-01-2022 11:41 AM - edited 04-02-2022 01:56 PM
@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.
04-01-2022 04:51 PM
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.
04-01-2022 07:11 PM - edited 04-01-2022 07:34 PM
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)
04-01-2022 08:07 PM
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?
04-01-2022 09:14 PM
@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)
04-02-2022 06:47 AM
@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).