LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get time and date format from window OS's settings?

Hi May i know how to get or read format settings from Window's OS settings for date and time?
Clement
0 Kudos
Message 1 of 7
(5,857 Views)
if you use the Get date/time string.vi it retrive windows time and date.
Software developer
www.mcm-electronics.com





PORTUGAL
0 Kudos
Message 2 of 7
(5,856 Views)

Do you want the actual time and date values as shown in the previous post or do want the format that the OS is using such as H:mm:ss:tt? Do you want to get this manually or programmatically?

 

JohnC-S

0 Kudos
Message 3 of 7
(5,827 Views)
Hi JohnCS and Jorge. Thanks for your reply.
I had problem with LabSQL. When I tried to query the value in timestamp, instead it gives , eg. 2/14/2008 12:23:14 PM, not 02142008122314. The problem lies with LabSQL.
It gives based on the WIN OS's time and date format.
So I am thinking of reading the property of the time and date format in WIN OS by programmatically. So that once the format is known, the value can be converted to timestamp correctly. The date and time format is different across different PCs.
Do I need to know which DLL that reveals the default or selected format?

Clement
0 Kudos
Message 4 of 7
(5,801 Views)

To view the configuration manually:

Go to Control Panels\Regional and Language Options\regional options\customize regional options\Time Format and you can see the format and change it if you wish.

 

To view the configuration programmatically, use the Read Registry Value Simple STR.vi to read the registry key:

         HKEY_CURRENT_USER\Control Panel\International\sTimeFormat

Message 5 of 7
(5,760 Views)
Hi JohnCS.
Many thanks. I had forgot all about using registry.
Huh, why so many similar threads to post?
Note: it should be Hkey._-Current_User\Control Panel\International\sTimeFormat
Thanks again.
0 Kudos
Message 6 of 7
(5,745 Views)
You can use a 'scan from string' function for this one,
%<%c>T should work for you

Ton

See here for all the info
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 7 of 7
(5,730 Views)