07-13-2010 09:22 AM
I am developing an application here in the US on English LV2009 software. This application will be installed in multiple areas around the world and I just came across an issue with date/time that I'm trying to figure out. Attached is a screenshot of the application running on a Chinese computer. In the upper right there is a "Results Save Location" that has a month and year appended to the filename. I'm using the format date/time with modifiers for month name and 4-digit year (%B %Y). On my PC it shows as July 2010, but on the Chinese computer it shows 7 01. Also, the reason it says bad serial number is that I'm comparing the SN to the 2-digit year and it seems to grab it incorrectly.
On my PC, I tried changing my date settings in Windows and it doesn't seem to affect the output like it does on the Chinese computer. I know there is a UTC boolean selector that can be enabled. Will that make a difference in how the date is displayed from this function?
This is one of a few issues I have come across when developing a program for multiple regions, but it is currently the only one I haven't solved yet.
Solved! Go to Solution.
07-13-2010 09:38 AM
I don't have LV 2009 installed, so I can't open your VI.
I'm guessing that you are using the Format Date/Time String function to name your file. If you do not specify a time format string, the default value is %c (locale specific).
To make your filename more universal, use a string format of
[%Y_%m_%d][%H_%M_%S]
UTC format to TRUE so that the time will always reflect a common reference.
07-13-2010 09:45 AM
Thanks for the reply. I don't need the actual time, just year and month so I was using %Y and %B respectively as the format. Will UTC affect how the date displays though? I would have thought a format of %B (month name) would give you the name of month regardless of locale.
07-13-2010 10:14 AM - edited 07-13-2010 10:17 AM
I would expect month name to be langauge specific.
For example, the word April in French is Avril and is abbreviated Avr. I would use a number rather than the name.
The Thai calendar is +543 years compared to the western calendar, so a Thai PC could show a locale specific date of 2553-07-13. Your computer might show 7/13/2010. I'm quite sure that the Chinese calendar year is different than the western calendar.
Using UTC should force LabVIEW to use the Gregorian calendar based on the standard ISO-8601.
Considering that your users are working with technology and would probably recognize a Gregorian year/month/day combo I would stick with %Y_%m_%d. and UTC = TRUE.
I contributed a VI to the NI Community that you could use if you like; it has lots of options and is based on ISO-8601
.
http://decibel.ni.com/content/docs/DOC-7199
07-13-2010 11:21 AM
Thanks for your input.