06-29-2014 02:54 PM
Hi I use the following code to convert timestamp to number and then convert it back to string but it doesn't work.
For example if teh current time is 12:52:30 the number will be 125230 but the the resulting string is 024710 .. Could you please let me know what is wrong here
Thanks
06-29-2014 03:39 PM
Well, the format of your number has no numerical relationship to the time.
This is the format that it appears that you want:
hour*10000 + minute*100 + second
To get that format you must implement that algorithm. There might be a simpler way but this will work:
Note that the Format Date/Time String function will use the current time if nothing is wired to the timestamp input.
To convert a number in that format to a string you must implement the reverse process of splitting the number into separate values for hours, minutes, and seconds. Then each must be converted to a string. The individual strings can be concatenated to form a single string.
Lynn
06-29-2014 05:00 PM
Seems like you're doing something funny, probably because you are using inappropriate functions for conversion. I have attached a couple of options of what I think you might be trying to do.