Quantcast
Channel: Adobe Community : Popular Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 14291

convert datetime to decimal

$
0
0

Does anyone know of a way to convert a datetime (like 2015-06-10 07:30:00) to a decimal, similar to:

42165.450 where 42165 is days and 450 is minutes?  If I try the following:

------------------------------------------------------------------

<cfset dtNow = "2015-06-10" />

 

<cfset dtOne = CreateDateTime(

    Year( dtNow ),

    Month( dtNow ),

    Day( dtNow ),

    07, <!--- 6 PM. --->

    30, <!--- 30 Minutes. --->

    00 <!--- 0 Seconds. --->

    ) />

 

<!--- Dump out result. --->

<cfdump var="#NumberFormat(dtone,'99999.99999')#" /><br>

------------------------------------------------------------------

I end up with 42165.31250

Thanks


Viewing all articles
Browse latest Browse all 14291

Trending Articles



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