LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel date conversion

Solved!
Go to solution

Hi All,

 

I have a created a program which takes all the data from different excel files and dumps into single excel file, after dumping the data the date format in column A and time format in column B gets disturbed.

 

In the original excel file date is in the format 12/16/2009 but when i dump the data into a new excel file it takes the format 40163 .

 

Similarly for time parameter in column B. All the time parameter are in the decimal format.

 

Why we find this kind of behaviour, I am using Excel get data VI to extract all data from excel file and Excel easy table to dump the obtained data.

 

How to convert back to original form ?

 

Thanks

Rohith

0 Kudos
Message 1 of 13
(4,882 Views)
just fromat the excel cells.  You have the right values they are expressed in number of days since 1900 for the date and a fraction of one day for the time. 

"Should be" isn't "Is" -Jay
Message 2 of 13
(4,878 Views)

Hi,

 

I know that thing, cant we do it programatically to avoid user intervention ?

0 Kudos
Message 3 of 13
(4,836 Views)
Solution
Accepted by topic author cancancanopen

You can format the cells programmatically before writing to the cells. I looks like you have the MS Office toolkit? If you do look at the help file for the Excel Set Cell Format.vi.  If you don't have the toolkit you will have to use ActiveX.

 

Hope this helps.

 

Also there is a repository of links here. But please don't pose questions there.

Message Edited by GovBob on 12-30-2009 10:43 AM
Message Edited by GovBob on 12-30-2009 10:45 AM
Now Using LabVIEW 2019SP1 and TestStand 2019
Message 4 of 13
(4,830 Views)

Hi,

 

formatting is a good option,

 

I had number 40163 i gave a format type mm/dd/yy

 

for date format h:mm AM/PM (12 hr format)

0 Kudos
Message 5 of 13
(4,810 Views)
I'm glad your question is now solved.  But please mark GovBob's reply as the solution to your problem rather than your own message.
Message 6 of 13
(4,795 Views)

Hello,

 

I too saw that, In hurry i pressed ...sorry for that. But how to mark that as solution now.

0 Kudos
Message 7 of 13
(4,786 Views)
un mark the wrong one first

"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 13
(4,768 Views)

If you could show me how, it will make my life easier.

 

Thanks.

0 Kudos
Message 9 of 13
(4,735 Views)

2 step.PNG

Try This


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 13
(4,730 Views)