LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variant to XML parser to string

Solved!
Go to solution

I am trying to trying to generate a data dictionary from a cluster using XML parser.  I am passing the cluster as a variant to LabVIEW's flatten to XML.

 

The variant timestamp goes in as:

 

 

14/08/1966 00:00:00

 

 

 

It comes out from the XML parser as :

 

 

<Timestamp>
<Name>PatientDoB</Name>
<Cluster>
<Name></Name>
<NumElts>4</NumElts>
<I32>
<Name></Name>
<Val>0</Val>
</I32>
<I32>
<Name></Name>
<Val>0</Val>
</I32>
<I32>
<Name></Name>
<Val>1976050800</Val>
</I32>
<I32>
<Name></Name>
<Val>0</Val>
</I32>
</Cluster>
</Timestamp>

How do I convert

1976050800

into year month day?

 

Thanks,

Seán

 

 

0 Kudos
Message 1 of 5
(3,024 Views)
Solution
Accepted by topic author SeanJ

That's the number of seconds since LabVIEW Epoch Time.  You can convert this directly into a timestamp.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 5
(3,015 Views)

That is the number of seconds since 01/01/1904 00:00:00.00 UTC.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 3 of 5
(3,008 Views)

Thanks All,

 

In my defense I went to :

 

https://www.freeformatter.com/epoch-timestamp-to-date-converter.html

 

I was looking at Unix time!  Actually, this is indefensible Smiley Embarassed.  Thanks again,

Seán

0 Kudos
Message 4 of 5
(2,986 Views)

Instead of converting it to XML and parsing it, you could try using the "Data Type Parsing" functions (under the Variant palette) to gather the name, type and value etc.

0 Kudos
Message 5 of 5
(2,985 Views)