LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

date format changes during write to spreadsheet file

Please see attached vi. I want to write the date in a simple mm/dd/yy format into the spreadsheet. The date is properly formatted in the string and the array, but the date written to the spreadsheet is mm/dd/yyyy. WHY????
0 Kudos
Message 1 of 4
(2,978 Views)

Hi wb2nvy,

 

that happens when someone creates textfiles and renames them to *.xls...

 

Open the created file in Notepad and you will see your choosen date format Smiley Wink Or to put it in other words: Excels does some formatting on it's own!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,975 Views)
Thanks Gerd. That explains it.
0 Kudos
Message 3 of 4
(2,961 Views)

Check the regional settings in Control Panel for the date format.

 

Windows likes to default the date to mm/dd/yyyy, so you'd wind up with a date like 01/09/2010 for Jan 9, 2010.  I feel the extra zero on a single digit month or day is just ugly.  And I don't want to waste the display space on a 4 digit year.

 

I like to make mine m/d/yy.  That way I get 1/9/10.  Single digit months and days only take up 1 digit as 1/9 instead of 01/09.  And a 2 digit year instead of 4.  It appears that the way Excel formats the cell for dates when it imports it from your text file is based on these Windows regional settings.

0 Kudos
Message 4 of 4
(2,955 Views)