LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Padding a julian date with leading zeros ?

Hi,
 
I have gernerated a julian date, which I am appending to another two digit number to create a five digit serial number.
Is there a simple way to pad the first 99 days with leading zeros ( i.e. 001, 002....025...099) so that I maintain a five digit serial number ?
 
I am using   Get Date In Time/Seconds > Number To Decimal String > Unbundle >Number to Decimal String.
 
Thank you in advance for any advice,
Alan
0 Kudos
Message 1 of 6
(4,112 Views)
You've got me confused as to what you mean by Julian calendar and days going up to 99.  I thought the Julian calendar was the one that was used from Roman times until about 1700's.
 
To get a 3 digit string, use the Format Into String function where the format string is %03d   That will create a 3 digit number with zeroes padded on the left.


Message Edited by Ravens Fan on 02-20-2008 11:51 PM
0 Kudos
Message 2 of 6
(4,109 Views)
The Julian day is the number of the day in the current year.
0 Kudos
Message 3 of 6
(4,103 Views)
Here's the simplest way to do it (with he 2 digit number), I believe:






Message Edited by Matthew Kelton on 02-21-2008 12:43 AM
Download All
Message 4 of 6
(4,099 Views)
Yes %<%j>T always returns the current day in 3 digits.
See here

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!
Message 5 of 6
(4,088 Views)

Many thanks for the responses ! I was able to create the desired string.

Alan

 

0 Kudos
Message 6 of 6
(4,055 Views)