LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Date/Time In Seconds problem

Solved!
Go to solution

Ok here's the thing: I'm using get current date/time, I convert it to a string and this string is logged in a CSV file -text-

 

Next, I built in a feature to plot previously logged data on an XY graph. I use search string to look for time values and convert it back to a timestamp.

 

Works like a charm.... BUT I noticed when I moved with my VI to another platform for some reason it has a different formatting of the system date/time, this is the case:

 


My  64 bit:
08:16:48.978 PM 08/02/2010


Someone else's windows 32 bit:
08:25:02,055  08/02/2010

 

 

Another issue is that it uses a comma instead of a period for fractional seconds.

 

So now here's the million dollar question: Where can I change this, preferably within labview? I want it to get date/time in AM PM regardless of platform and use period for fractional seconds.

 

Thanks!

 

 

'

0 Kudos
Message 1 of 8
(6,360 Views)

i've found that you can adjust Window's notation of time and date by running intl.cpl  -region and language settings-

Is there a way to make Labview adjust this automatically?

0 Kudos
Message 2 of 8
(6,353 Views)

Can you show what code you used? There are quite some date/time to string conversion tools, and each has a different approach to get a system independend string.

 

Ton

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!
0 Kudos
Message 3 of 8
(6,344 Views)

Yes absolutely, it is added.

 

Another request: I'd like to have fractional seconds in my timestamp. Possible?

 

0 Kudos
Message 4 of 8
(6,337 Views)
Solution
Accepted by topic author _Faust

Here is a possibilty, since you use the 'Format Date/Time String' you can use the same format string to scan the timestamp:

Example_VI.png

 

The fact that a ',' is used is a bug of LabVIEW and still not fixed. Where do you need the fractional seconds? The timestamp data itself always has full info on the timestamp. Representation (either as string or timestamp indicator) can be made in any way (even timezone independent).

 

Ton

 

PS Geinig om nederlands commentaar te zien

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 5 of 8
(6,321 Views)

_Faust wrote:

 

Another issue is that it uses a comma instead of a period for fractional seconds.

 

So now here's the million dollar question: Where can I change this, preferably within labview? I want it to get date/time in AM PM regardless of platform and use period for fractional seconds.

 

Thanks!

 

 

'


I really have no idea if that could be the case, but maybe it's worth giving it a chance. In LabVIEW try going to Tools -> Options... ->  Front Panel -> General -> Use localized decimal point* and check/uncheck it.

 

*Changes to marked options will take effect the next time you start LabVIEW.

 

Maybe on the other system where you have loaded yor program the local settings are different. 

Message Edited by Giedrius.S on 02-08-2010 11:54 PM
---

While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that... 🙂

Chart zoom with "Mouse Over" effect
Message 6 of 8
(6,302 Views)

Ton,

 

On my 64 bit system, which is configured as international, I do get fractional seconds with a period as delimiter.

 

If you're running windows 7 -or vista- you can change the comma to a period in the region settings and then click on advanced. I think that setting has effect on labview's time formating. I will double check on that though.

 

 

Thank you for your help.  I already checked your website on the Dutch Labview Users Group.

0 Kudos
Message 7 of 8
(6,265 Views)

Ton,

 

Als je dit nog leest: Ik heb je code-capturing-tool gedownload. Ik zie dat je een enorme professional bent, en ik zou

graag eens in contact komen, wellicht dat ik nog wat kan leren. Je kan mailen naar felix <at> arthecom punt nl.

 

 

Ik zelf schrijf programmatuur voor de universiteit die pilots en dergelijke aan moet sturen. Ben nog redelijk n00b en zou

graag van professionals leren.

 

Fijne dag  nog.

 

0 Kudos
Message 8 of 8
(6,260 Views)