LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change Julian date string to Normal Date string

Solved!
Go to solution

I need to change a Julian Date code (string format) to a Normal Date code (string format).  This is not in real time so using Get Date doesn't seem to be the solution (unless someone else has a way to do this).  I am reading a scanned in date in the format:

YYDDD

and would like to change it to:

YYMMDD

 

Is there a quick function or easy way to do this?

Thanks!!

-ncm
0 Kudos
Message 1 of 8
(5,792 Views)
Solution
Accepted by topic author ncm

Scan from string followed by a format into string using the right time codes for the format strings.

 

Message 2 of 8
(5,776 Views)

I was drawing up code for this question and came up with the same solution expecting for it to work but I get a totally different answer.  

Example_VI.png

aputman
0 Kudos
Message 3 of 8
(5,762 Views)

The issue seems to be related with the LV version. Running your code in LV2014 gave me the same result as RavensFan, running it in LV2012 gave me the same answer as you.

 

Ben64

0 Kudos
Message 4 of 8
(5,758 Views)

I remember this "feature", I think if you try '0015123' in LV12 it works.

Message 5 of 8
(5,748 Views)

@Darin.K wrote:

I remember this "feature", I think if you try '0015123' in LV12 it works.


Sure enough.  That's a "useful" "feature".

aputman
0 Kudos
Message 6 of 8
(5,743 Views)

That brings back memories.  I had come across a bug in LabVIEW 2012 that was related to time stamp codes and 2 and 4 digit years.

 

See http://forums.ni.com/t5/LabVIEW/Scan-from-String-to-get-Timestamp-Problem-in-LV-2012/m-p/2774248#M81... where it talks about CAR300375

0 Kudos
Message 7 of 8
(5,728 Views)

Thanks everyone!  All answers were helpful, I am using LabVIEW 2010 so I needed the additional "00" in the front as well.

-ncm
0 Kudos
Message 8 of 8
(5,669 Views)