06-08-2022 04:25 PM
So used the "Get Date/Time in Seconds.vi then converted it to a DBL and used this to write the timestamps in Excel and that works fine,
I need to know the formatting in Excel to display the number as the original timestamp. I've tried using the "format cells" from the dropdown menu then chose "custom" from the category and tried entering what I thought would be the correct formatting but it can't convert and returns pound signs instead.
Does anyone know the format string to get the time stamp back to the original?
Thanks in advance.
Solved! Go to Solution.
06-08-2022 05:19 PM - edited 06-08-2022 05:21 PM
Literally the first hit in google.
https://forums.ni.com/t5/Example-Code/LabVIEW-Time-to-Excel-Time-Format/ta-p/3503346
Make sure you read the comments about how to handle the time-zone difference too.
06-09-2022 07:36 AM
Thanks - think I could find that on this sit - LOL!!
06-09-2022 10:07 AM - edited 06-09-2022 10:09 AM
If you are saving your timestamp like this:
In Excel the "raw" timestamp should look like this:
Highlight the column and select the format you desire:
That changes it to this:
Here's the same timestamp in another format:
Select "General" to change it back to the "raw" timestamp.
Back to raw...
If this does not work the same for you, then you are probably not saving your timestamp with enough digits of precision.
06-09-2022 10:59 AM
Thanks - that makes sense and I just checked on the digits of precision and it is set to 6 digits - hw many digits are needed to save a time stamp?
06-09-2022 11:26 AM - edited 06-09-2022 11:41 AM
@FishBonze wrote:
Thanks - that makes sense and I just checked on the digits of precision and it is set to 6 digits - hw many digits are needed to save a time stamp?
I am not really sure... I don't mess with precision, I save everything in full precision.
Here's what one of my raw data files looks like in Notepad. (I save everything in Tab delimited text files)
But it looks like 6 digits should be enough... Although beware of rounding when changing precision.
06-09-2022 12:21 PM
Hi,
Thanks but that is not working for me. The raw data does not look like yours either.
I ran that code snippet and hand copied the result from the indicator to a cell in an Excel sheet and it will not convert - just shows pound signs as in my original post. I am using Excel from Office 365 - does that matter?
06-09-2022 12:32 PM
If it just shows # signs maybe try increasing the physical size of your cell.
06-09-2022 12:37 PM
The number is is the cell and I can see it in it's entirety, all attempted conversions results in excel showing pound signs # no matter how big the cell is, my screen shot of Excel illustrates what I am seeing, even if I copy the number directly into the cell and try to manually convert it back.
06-09-2022 12:58 PM
@FishBonze wrote:
The number is is the cell and I can see it in it's entirety, all attempted conversions results in excel showing pound signs # no matter how big the cell is, my screen shot of Excel illustrates what I am seeing, even if I copy the number directly into the cell and try to manually convert it back.
I am going to have to see your code, because something weird is going on...
I have been doing it this way for years without issue, and we are on Office 365 now so it's not that.