07-28-2011 03:49 PM
Hi All,
I want to get the string "7/28/2011 3:31:18 PM" as is from the Elapsed Time VI Present Time Setting into an Array that I'm using as a write-out file. I tried using the "Scan From String" function but I can't seem to get the right Format String. I found the "Syntax elements" but they seem to use different combos then the example given for time in the "Scan From String" function help box.
Thank you for your help,
Falcon9a
07-28-2011 04:05 PM
Hi Falcon,
that should give you a kick:
Btw.: that doesn't seem to recognize the AM/PM flag - at least on my German WinXP. So someone else may shed some light on this. But: Who uses 12hour time format string for scientific data?
07-28-2011 04:21 PM
@GerdW wrote:
Hi Falcon,
Btw.: that doesn't seem to recognize the AM/PM flag - at least on my German WinXP. So someone else may shed some light on this. But: Who uses 12hour time format string for scientific data?
Try this
the Indicator is set for system time format- and those darn AM PM flags a system dependant- better to just let the system setting work for us rather than fight them.
07-29-2011 02:02 AM
07-29-2011 05:35 AM
A drill through the format strings help will eventually get to the table of the time strings. In a footnote, it says,,,
So,, Use %I (In phonetic alphabet that's upper case India) instead of %H
One route to the help page is via the Help Contents
VI and function reference --> String Functions --> Format Codes for the Time Format String
Rod
07-29-2011 07:54 AM - edited 07-29-2011 07:56 AM
@GerdW wrote:
Hi Jeff,
"better to just let the system setting work for us"
Well, this will only work in the US...
Not quite the Elapsed Time vi. (if you care to drill through the vi) returns "Present Text" as string from a Format date/ time primative with the default (%c) format. %c is equall to %<%x %X>T universally! Even in Germany!
Note: I forgot about %c... but who likes to write "c" in LabVIEW anyway?
07-29-2011 08:32 AM
Cool, that seem perfect, but now how do I turn the red line into an orange one?
Thank you,
Falcon9a
07-29-2011 08:37 AM - edited 07-29-2011 08:41 AM
@Jeff Bohrer wrote:
Not quite the Elapsed Time vi. (if you care to drill through the vi) returns "Present Text" as string from a Format date/ time primative with the default (%c) format. %c is equall to %<%x %X>T universally! Even in Germany!
Perhaps. But (at least in LV2009) %x %X and %c LOCALE-SPECIFIC.
Thus on my system, 29/7/2011 02:03:04 AM and 29/7/2011 02:03:04 PM (using %c format) both refer to the early morning today 29/07/2011. The AM or PM is not scanned/ignored as the format has been satisfied after the "04"
Rod (in the UK)
EDIT: Using format date/time string, with format "%c" is is now a little after 29/07/2011 14:39:32
07-29-2011 08:50 AM - edited 07-29-2011 08:52 AM
@Rod wrote:
@Jeff Bohrer wrote:
Not quite the Elapsed Time vi. (if you care to drill through the vi) returns "Present Text" as string from a Format date/ time primative with the default (%c) format. %c is equall to %<%x %X>T universally! Even in Germany!
Perhaps. But (at least in LV2009) %x %X and %c LOCALE-SPECIFIC.
Thus on my system, 29/7/2011 02:03:04 AM and 29/7/2011 02:03:04 PM (using %c format) both refer to the early morning today 29/07/2011. The AM or PM is not scanned/ignored as the format has been satisfied after the "04"
Rod (in the UK)
EDIT: Using format date/time string, with format "%c" is is now a little after 29/07/2011 14:39:32
did you start with the output from "present text" out of Elapsed Time vi on your pc or the litteral text from the OP? What are your local specific settings (24 hr clock maybe? "14:39:32")
07-29-2011 09:02 AM
Jeff Bohrer wrote:
did you start with the output from "present text" out of Elapsed Time vi on your pc or the litteral text from the OP? What are your local specific settings (24 hr clock maybe? "14:39:32")
I've just tried again.
New VI. Drop an elapsed time.vi.
Right click on the present text output. Create indicator
Run the Vi.
I get 29/07/2011 14:56:00
I have my locale set to English (United Kingdom)
Thus the standard settings of dd/mm/yyyy HH:MM:SS (24 hour clock) are in effect.
Rod