Authorize.net timestamp wrong due to Daylight Savings

Posted on 2012-03-27
Medium Priority
Last Modified: 2012-04-11
I have an e-commerce site that uses Authorize.net SIM Gateway for processing credit cards.  A unique fingerprint is created for each transaction using a timestamp.  When daylight savings changed, it no longer matches authorize.net time stamp.  My host has verified the settings on the server and it still does not work, so I am forced to fix this within the code.

This is the current code that I am using for the timestamp:
<cfset timestamp=DateDiff("s", "January 1 1970 00:00", DateConvert('local2UTC', Now())) >

I have found other scripts, but they are even further off.

The timestamp can be checked by going to the following link:

Authorize.net says the following:
The transaction fingerprint depends on a timestamp expressed in POSIX Time, sometimes called UNIX Epoch Time. Simply put, it is the number of seconds since January 1, 1970, at Midnight UTC. If you take the current time in the server’s time zone and convert that to UTC, and then use that to calculate POSIX Time, that may introduce the risk of the time being miscalculated when the server switches from Standard Time to Daylight Savings Time. This will cause transaction fingerprints to fail.

To avoid this, we (authorize.net) recommend the following:

-Take care to use whatever options are available in your scripting language of choice to use POSIX time automatically, instead of trying to convert from local time to POSIX time. Most scripting languages support POSIX timestamps.
-Make sure the Web server is using UTC, not local time.
-The operating systems on Web servers should be kept up to date. Since Daylight Savings Time is defined by law and is subject to change, servers may need to be updated to reflect changes.
-Where possible, Web servers should use the Network Time Protocol (NTP) to keep their clocks synchronized.
Question by:lonnyo
  • 2
LVL 36

Expert Comment

ID: 37771612
LVL 53

Expert Comment

ID: 37771876
> no longer matches authorize.net time stamp

I know you said the host check the settings, but without knowing more it does sounds like something on the server is off. How much is it off by? If it's about an hour, the DST settings on your server may be wrong.  For example, one of my test boxes was not set to DST time, so my timestamp was ~3660 seconds/1hr off from theirs

What are your timezone settings?

myTime  #now()#<br>
UTC Time #DateDiff("s", "January 1 1970 00:00", DateConvert('local2UTC', Now()))#<br>

<cfdump var="#getTimeZoneInfo()#">

Author Comment

ID: 37772292
Thanks for the quick responses.  I got pulled onto another project, so I will get back to this later today.  Sorry about that.
LVL 53

Accepted Solution

_agx_ earned 2000 total points
ID: 37772511
No problem.  I may get caught with stuff this afternoon, but will try and check back later.

Small correction to the debug code above:

myTime  #now()#<br>
UTC Time #DateConvert('local2UTC', Now())#<br>
timestamp #DateDiff("s", "January 1 1970 00:00", DateConvert('local2UTC', Now()))#<br>

<cfdump var="#getTimeZoneInfo()#">

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
Watch the video to know how one can repair corrupt Exchange OST file effortlessly and convert OST emails to MS Outlook PST file format by using Kernel for OST to PST converter tool. It can convert OST to MSG, MBOX, EML to access them. It can migrate…
Did you know PowerShell can save you time with SaaS platforms? Simply leverage RESTfulAPIs to build your own PowerShell modules. These will kill repetitive tickets and tabs, using the command Invoke-RestMethod. Tune into this webinar to learn how…

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question