Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

How do I convert a hex date?

$
0
0

When outputting meta data from SharePoint Foundation 2010 using cfsharepoint I am noticing datetimes are being converted to the following format:  0x01cf2d81|0x71c80a00

 

How do I convert this to a regular date using ColdFusion?  I have found some references to this issue here http://sharepoint.stackexchange.com/questions/66602/dates-and-times-in -properties-vs-fields/91069#91069 which shows a solution like this:

 

 

//fieldValue looks like "0x01cf2f8e|0x6e559e00"
string fieldValue = listItem.Properties[dateFieldName]
string hexValue = fieldValue.Replace("|", "").Replace("0x", "");
long ticks = long.Parse(hexvalue, NumberStyles.HexNumber);

DateTime date1 = DateTime.FromBinary(ticks).AddYears(1600);

 

But I have no idea how to do this in ColdFusion.  Apparently the hex value represents the number of ticks since 1st Jan 1600.  Crazy, I know.

 

Any ideas??  Thanks.


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>