From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Format Date Time string language

When I use Format Date Time to get the current date with full name of the month (%d-%B-%Y) I got result with month's name in German, do you know how to get it in English?

OS language is English, but location german...

 

0 Kudos
Message 1 of 11
(1,798 Views)

Hi,

 

set the location to UK...

 

LabVIEW respects your local regional settings, so it gives German month names. When you need to be independent from OS settings you could implement your own conversion from month number to name...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(1,779 Views)

app will run on various machines in Switzerland, it's not an option....

0 Kudos
Message 3 of 11
(1,770 Views)

@tcie wrote:

app will run on various machines in Switzerland, it's not an option....


So what do you want? That the shown text respects the local setting or that the text is in English? You can't have both!

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 11
(1,760 Views)

@tcie wrote:

app will run on various machines in Switzerland, it's not an option....


It's the only option. 

 

It's simple: either live with the names given by the OS, or convert month number to your own name.

 

Why isn't that an option?

0 Kudos
Message 5 of 11
(1,757 Views)

That I know, I wonder if there's an elegant way to do that 😉

0 Kudos
Message 6 of 11
(1,743 Views)

@tcie wrote:

That I know, I wonder if there's an elegant way to do that 😉


That depends a bit on how you're going to use it.

 

If you (or the user) specify the formatting from a file, you'd have to search and replace the resulting string.

 

If you have a VI that takes a timestamp, and outputs a string, it can be a lot simpler. An enum could also be used...

Non Local Month Names.png

0 Kudos
Message 7 of 11
(1,732 Views)

Hi wiebe,

 

that Dutch "mei" is nice! 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 11
(1,697 Views)

like I've told changing it is trivial, but I was hoping that there's build in way to do it

0 Kudos
Message 9 of 11
(1,677 Views)

Hi tcie,

 


@tcie wrote:

but I was hoping that there's build in way to do it


The "built-in way" is to rely on the OS regional settings (either configured by the user or by the company admin).

When you want something different than the OS regional settings then you need to program it: you already got solutions…

 


@tcie wrote:

like I've told changing it is trivial


Yes, even wiebe's example is trivial.

You can pimp it up by implementing configuration files and options for your users to change the language/localization of your software…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 11
(1,674 Views)