LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting LV Time Stamp from Excel

Solved!
Go to solution

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,

 

FishBonze_0-1654723060122.png

 

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.

 

FishBonze_1-1654723220757.png

 

 

Does anyone know the format string to get the time stamp back to the original?

 

Thanks in advance.

0 Kudos
Message 1 of 22
(1,603 Views)

Literally the first hit in google.

Frozen_0-1654726700374.png

 

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.

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
Message 2 of 22
(1,593 Views)

Thanks - think I could find that on this sit - LOL!!

0 Kudos
Message 3 of 22
(1,556 Views)

If you are saving your timestamp like this: 

t1Capture.PNG

 

In Excel the "raw" timestamp should look like this:

t2Capture.PNG

 

Highlight the column and select the format you desire:

t3Capture.PNG

 

That changes it to this:

t4Capture.PNG

 

Here's the same timestamp in another format:

t6Capture.PNG

 

Select "General" to change it back to the "raw" timestamp.

t7Capture.PNG

 

Back to raw...

t8Capture.PNG

 

If this does not work the same for you, then you are probably not saving your timestamp with enough digits of precision.

========================
=== Engineer Ambiguously ===
========================
Message 4 of 22
(1,538 Views)

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?

0 Kudos
Message 5 of 22
(1,522 Views)

@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.

 

t9Capture.PNG

 

Here's what one of my raw data files looks like in Notepad. (I save everything in Tab delimited text files)

 

t10Capture.PNG

 

But it looks like 6 digits should be enough... Although beware of rounding when changing precision.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 22
(1,512 Views)

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?

0 Kudos
Message 7 of 22
(1,499 Views)

If it just shows # signs maybe try increasing the physical size of your cell.

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 8 of 22
(1,492 Views)

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.

0 Kudos
Message 9 of 22
(1,486 Views)

@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.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 10 of 22
(1,478 Views)