LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Date Formating

Am I missing something or does the "Format Date/Time String" not have the Month or abbreviated month name?

I can only find the number of the month in the NI Date/Time String Format.

My problem is formating the data I recieve from a database. An example of the information is "4/20/2005 2:46:58 PM" in string format. I would like to format this string into "Apr. 20, 2005 2:46PM".

I can write a VI to perform this function but I would think that this is a standard formating requirement and I must be missing something.

Thanks for your help.
0 Kudos
Message 1 of 7
(3,581 Views)
Look for "Format Date/Time String" in the Time&Dialog Palette.

(e.g. abbreviated month name is %b)


Example: Use format "%b %d, %Y %I:%M%p" to generate "May 25, 2005 08:59AM"

(edit: added example)

Message Edited by altenbach on 05-25-2005 09:10 AM

0 Kudos
Message 2 of 7
(3,577 Views)
For some reason, they did not include all of the formatting options in context help window. If you click on the link at the bottm of the context help window; it will bring up the full help for this VI. You then need to select a link in it to time format codes (or search the full help for date format codes). There you will find several that did not make it into the context help.

That is where the %b and %B come from.

Hope that this helps,
Bob
0 Kudos
Message 3 of 7
(3,569 Views)
Thanks you very much. I re-looked at the help in the LabView 7.1 and for some reason I do not have that option. Nevertheless the %b worked for me.

Thnak you again,
Paul
0 Kudos
Message 4 of 7
(3,566 Views)
You must have missed the link as described in Bob's post, I'm sure it's there. Here's the full help window you should see. 🙂

Message Edited by altenbach on 05-25-2005 09:53 AM

Message 5 of 7
(3,554 Views)
Sorry for being a pain but I am still having troubles formating the date from my database. I have attached a very small vi simulating what I am trying to do.

Thanks once again.
Paul
0 Kudos
Message 6 of 7
(3,539 Views)
You need to scan it from string then bundle the "date time record". There is now easy way to handle all possible formats automatically. See attached.

(also note that minutes is %M, you are using %m, which is "month").

Message Edited by altenbach on 05-25-2005 11:42 AM

Message 7 of 7
(3,528 Views)