Example Program Drafts

Showing results for 
Search instead for 
Did you mean: 

Convert Excel Time Stamp to LabVIEW Time Stamp

by Member Prabhakant_Patil on ‎07-18-2011 01:16 AM

Hi All

This VI will covert Excel time stamp into Labview time stamp.

Note -  Excell date format should be MM/DD/YYYY

If Date format is changed, you have to change in the code.

There are Two example

1. Using ActiveX control

2. Using Report Generation Toolkit.

If You Have any suggestions or Query, the please let me know.

Please give your comments

Regards

Prabhakant

Read Excel.PNG

Comments
Member Prabhakant_Patil
Member

Kindly Write the Suggestions, Rating on this example

Prabhakant

Member Srikanth@Siri
Member

you have done a good job it is useful for our project.....

Member Prabhakant_Patil
Member

If you get any issue, then please let me know

Prabhakant

Member Abhi3345
Member

nice work PC

Member Prabhakant_Patil
Member

Thanks Dude

Member Prabhakant_Patil
Member

Please click on like if you like it.

Your valuable suggestions are always welcome for the improvement.

Regards,

Prabhakant

Proven Zealot Proven Zealot
Proven Zealot

I would like the code more if it gave the correct answer. As it is, the example Read Excel.vi returns values that (compared to the Excel file) are off by several hours. Did you correct for GMT, DST? Oh yes, the example Read_Excel_report.vi gives a different wrong answer.

Mike...

Member Prabhakant_Patil
Member

Is your excel file has the following format

Note -  Excell date format should be MM/DD/YYYY

If Date format is changed, you have to change in the code.

Proven Zealot Proven Zealot
Proven Zealot

Actually, I just opened your code and ran it against your excel file and the answers are wrong - the code is overly complex and doesn't handle GMT or DST properly. Also what difference does it make what the format in excel is? That isn't what you are reading.

The date column holds the integer number of days since 12/30/1899. To convert that into the number of days since LV's beginning of time (1/1/1904) you have to add 1462 and then convert to seconds by multiplying by 86400 - both of which you got right. But why the pointless reformatting that follows? Should I go into the problems with your subVI?

The time column from the excel spreadsheet contains the fractional number of days since midnight, multiply that by 86400 and you get the number of seconds since midnight. However you still have to account for both GMT difference and DST to get the time to display correctly in LV. To do that, take the number of seconds you are offset from GMT and if your location is on DST subtract 3600 from that number (the number of seconds in one hour). Now sum this result with the number of seconds since midnight and the number of seconds since midnight 1/1/1904 and convert the result into a timestamp using the To Timestamp function.

Mike...

Member Prabhakant_Patil
Member

Hi Mike

Thanks for the suggestions.....

I will try this

Prabhakant

Member GriffinRU
Member

I think you will find this link helpfull and to support Mike's comments Excel's format won't be an issue.

Enjoy,

-Artur

Member makadiakishan9922@gmail.com
Member

MY PROJECT IS IMAGE PROCESSING BASED SHOPPING COUNTER USING WITH LABVIEW......BUT PRODUCT IS DETECT BUT ITS BILLING PROCESS IS NOT GENRATE....SO PLS HELP ME.........SO PLS GENRATE EXCEL FILE MEANS ONE TYPE OF BILL SYSTEM

Member shijianshisjian
Member

pretty for my job

Member macroline
Member

Can the file be read without the "read file" pop up message? I need to pass the file from the another vi and make read excel.vi  as a sub vi. Kindly help.

Member 0Forest0
Member

To correct convert time from excel to labview we shell save and read time zone whith timestamp.