How to convert this hex string into a long?

Daniel Minnaar picture Daniel Minnaar · May 15, 2013 · Viewed 20.2k times · Source

I have: "0xE94C827CEB" in hex but as a string.

Which is: 1002011000043 (dd mm yyyy HH mm ss)

Unfortunately I don't know how to do the conversion if I only have it in string format, and I don't have a Convert.ToLong("0xE94C827CEB", 16) function because I'm using the .NET Micro Framework (also, don't have NumberStyles namespace available.)

Is there a function out there that will convert this for me?

Thanks

Answer

Zapnologica picture Zapnologica · Oct 14, 2015

For those of you looking for the answer using the full .NET framework for pc.

long answer = Convert.ToInt64("E94C827CEB",16);

see: MSDN Documentation