LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dayofyear conversion

I have a date/time string format as:  "YYYY:DayofYear:Hours:Minutes:Seconds" (for example: 2006:356:11:23:35).  I need to convert the date/time string to seconds.  The "Date/Time to Seconds" function requires the "month" and "date_of_month" fields to conver to the time stamp.  Here are my questions:
(1) If we have the "DayofYear" and "Year", why the "Dat/Time to Seconds" can't convert it to time stamp.  The function should be smart enough converting either user provides "month" and "day_of_month" or "DayofYear".
(2) Any available VI doing "dayofyear" conversion to "month" and 'date"?
 
 
 
 
 
0 Kudos
Message 1 of 4
(4,202 Views)


@TonyMao wrote:
(1) If we have the "DayofYear" and "Year", why the "Dat/Time to Seconds" can't convert it to time stamp.  The function should be smart enough converting either user provides "month" and "day_of_month" or "DayofYear".

I agree, this would be a nice feature. Of course if somebody would provide both, and the values don't agree, which one should take predence?

(right now, the "day of year" seemingly gets corrected, and its value ignored, if you provide both.)

0 Kudos
Message 2 of 4
(4,194 Views)
Thanks, Unclebump.
 
I found the 4247.vi to use dayofyear number to construct time stamp and then converts to the seconds properly.   The vi wirtes the "day_of_year" number to the "day_of_month" field and set the month field to "1" (January).  The trick seems working fine as long as LabView doesn't validate the "day_of_month" (1 to 31 according the documentation).
 
 
0 Kudos
Message 4 of 4
(4,051 Views)