Skip to main content
Inspiring
August 27, 2008
Question

Add 3 hours to Now()

  • August 27, 2008
  • 2 replies
  • 405 views
My host is 3 hours behind us. My client wants a timestamp (eastern time) on emails notifying changes in the system.
How can I add 3 hours to now in a TimeFormat()?

Thanks
    This topic has been closed for replies.

    2 replies

    Inspiring
    August 27, 2008
    "dateadd"
    August 27, 2008
    Here is the syntax for the dateAdd
    #timeFormat(dateAdd("h",3,now()),"h:mm tt")#

    However what if you change hosts? If you have the timezone of your client / user then you can get the UTC time and then cast that to your client's time. All of my time in my applications centers around UTC so that way I don't have to worry about the fact that the server is in Dallas and the client is in Seattle and their times don't line up.
    Inspiring
    August 27, 2008
    Step 1 - use datediff to add the 3 hours
    Step 2 - format the result with dateformat and timeformat.

    All three functions are described in the cfml reference manual. If you don't have one, the internet does.