Skip to main content
Inspiring
May 3, 2011
Question

convert unusual transaction time format ?

  • May 3, 2011
  • 3 replies
  • 1578 views

Need a little bit of help transforming a date arriving from a payment gateway into a usuable date for coldfusion

Here's the format the payment gateway says its in

"Time of the transaction in milliseconds since the start of 1970 GMT."

"This is the standard system date in Java, and is also 1000x the standard C time_t time.

typical value of the incoming data (millisecs):

999178402000

What CF command do you use to convert it into a date/time ?

    This topic has been closed for replies.

    3 replies

    talofer99
    Inspiring
    May 3, 2011

    <cfset dateParseing = CreateObject("java", "java.util.Date")>

    <cfdump var="#dateParseing.getTime()#">

    Inspiring
    May 3, 2011

    I always check cflib.org first. They almost always "have a function for that...". At the very least one you can adapt.

    http://www.cflib.org/udf/millisecondsToDate

    Inspiring
    May 3, 2011

    wow, that's a great one to know

    talofer99
    Inspiring
    May 3, 2011

    I later noticed that this is not what u asked for ... but it is a good one

    Inspiring
    May 3, 2011

    dateadd()