We help IT Professionals succeed at work.
Get Started

Authorize.net timestamp wrong due to Daylight Savings

lonnyo
lonnyo asked
on
878 Views
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:
http://developer.authorize.net/tools/responsecode97

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.
Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2015
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE