Consideration needed when using the now() function

I came across a post the other day, and the problem was that the date expected was not what was being returned. It seems that a lot of people, and I was guilty of this in the past.

The person was seeing a date difference of one day, so what would be the cause of this you ask.

The problem is simple, the server hosting the website was in the United Kingdom, and the developer was in the USA. So with the time difference, servers can report an unexpected date when you use the Coldfusion function now() as it will always report the servers date and time.

So what is the answer, in short the answer is to look more towards the demographic usage of your website. So if you host in the UK and your demographic market is the USA then you will need to offset your date and time with the UTC + 7 (From memory) and also depending on which part of the USA you are in.

There are many ways this can be achieved, but if you have a memeber sign in then you could just get their address details and do an offset that way, or you could take the ip address of the client / user and automatically had the offset date / time.

Either way, one can not just expect that the date / time will be the same as where you are developing from.