Reply to topic
Time Zone Offset For Current Time Display Using CF
scottmac


Joined: 26 Dec 2006
Posts: 13
Reply with quote
I'm using this: #LSTimeFormat(Now(),"h:mm tt")#

To display the current local time on a website. I can't find any reference anywhere to setting an offset for the time zone for the display.

The HMS server is (obviously) on Eastern Time

My local site is on Mountain Time -- not practical to set the server time to MST because I have other sites which need to display current time in their local time zone. Surely there must be a simple timezone offset to set time on a site by site basis?

Any help would be appreciated - I'm not a full-time CF coder so my skills are limited currently.
bobclingan
Forum Regular

Joined: 16 Sep 2004
Posts: 271
Location: Abingdon, MD
Reply with quote
You can include the a specific time zone to get the result you want ie:

Code:
mmmm dd, yyyy h:mm:ss tt zzz


Where zzz is your time zone like PST, MST, etc....
Strange display when specifying time zone
scottmac


Joined: 26 Dec 2006
Posts: 13
Reply with quote
Thanks for the reply -

I added the time zone spec in this form:

#LSTimeFormat(Now(),"h:mm MST")#

This is what I have displayed on the page at 5:40pm MST: "12:40 35A"

It's consistently a 7 hour offset. I've confirmed that the date/time setting on the server is correct (I'm on a VPS)

Weird?? Any ideas??
bobclingan
Forum Regular

Joined: 16 Sep 2004
Posts: 271
Location: Abingdon, MD
Reply with quote
My bad- that was for display purposes not conversion... here is something that should do the trick...

http://www.cflib.org/udf.cfm?ID=373
Time Zone Offset For Current Time Display Using CF
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic