Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adjust for Time Zone Differences?

Status
Not open for further replies.

xtendscott

Programmer
Joined
Apr 21, 2003
Messages
276
Location
US
I have a host in Eastern Time and I want the time in Pacific time. (3hr difference).

What is the best way to set Mytime = now() - 3hrs?

I haven't dealt much with time manipulation.

Thanks in advance.

XtendScott
Walla Walla Info - Web Design
 
xtendscott, for the 1st question, try:
Code:
3 hours ago:  
<cfset myNewTime = #DateAdd('h',-3,now())#>
<cfset myTime = timeformat(myNewTime , "hh:mm:ss tt")>
If you wanna get more complicated you can use the LSTimeformat() function,
The second question use the dateformat() along with myTime, as:
Code:
<cfset myNewDate = dateformat(now(),"mm/dd/yyyy")>
<cfset together = #myNewDate # & " " & #myTime#>


____________________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top