LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Date / time not displayed in correct format

Hi
 
I want the Date and Time to be displayed as 03 - 08 - 2005  4:46 PM format. ( that is %d- %m - %Y %I : %M %p) format in my Excel sheet.
 
The format comes correctly if the date is 13 August to 31 August. But before 13 that is from 1 august to 12 august, i am getting the default format that is 03/08/2005 4:46 even though i have given the format correctly using the Format date/Time String VI
I have used Excel Easy Text.VI to place my date/Time String in excel sheet. Why is the format not coming correctly?
 
 
Thanks ..Hemaa
 
 
0 Kudos
Message 1 of 6
(3,533 Views)
Hello,
 
Let me make sure I understand you correctly.  You define the cell format manually in excel, and thereafter, the strings you write to those cells are not represented with the format you set?  Can you post a screenshot of your block diagram and your excel worksheet?  Also, can you post a screenshot of your cell format selection (showing the selection after, presumably, you right click and choose to format cells?
 
I would like to recreate this so I can explore solutions!
 
Thank you,
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 2 of 6
(3,511 Views)

Hi,

I have attached the VI called Store_TimeStamp.vi.

Please see this VI. Here I am using Format Date/Time String.VI to format the TimeStamp and used Excel Easy Text.VI to place the value in a cell in Excel file.

 

Thanks, Hema.

 

0 Kudos
Message 3 of 6
(3,491 Views)
Hello,
 
Ok, this seems to be a bug/feature in Excel, and not something wrong with the toolkit.  That is, if you write a string in the format we are writing them to an excel file using just the file I/O VIs, you will see the same behavior.  I believe Excel is making the decision to format the cells into one of it's time formats automatically.  Although I am not sure how to do this, you may be able to configure Excel not to do such things, and this should remove the problem!
 
Let me know if you have trouble figuring out how to do this in Excel, and I can explore the Excel features with you!
 
Thank you,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 4 of 6
(3,476 Views)
Hi again,
 
Attached is a modified version of your VI which shows using the File I/O VIs will produce the same results, as described in the previous post.
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 5 of 6
(3,475 Views)
Oops.. you'll need the attached subVI as well 🙂
Best,
JLS
Sixclear
0 Kudos
Message 6 of 6
(3,471 Views)