Created
February 25, 2017 14:02
-
-
Save anonymous/26f5bce31db7787f4591317b7360ceb7 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset departure = CreateDateTime(2017,01,27,21,00,00)> <!--- (this time zone is +2) ---> | |
<cfset arrival = CreateDateTime(2017,01,28,06,40,00)> <!--- (this time zone is -5) ---> | |
<cfset depart_timezone = -2> | |
<cfset arrive_timezone = 5> | |
<cfset tzDeparture = DateAdd('h',depart_timezone,departure)> | |
<cfset tzArrival = DateAdd('h',arrive_timezone,arrival)> | |
<cfset difference = datediff("n",tzDeparture,tzArrival)><!--- get the difference in hours ---> | |
<cfoutput> | |
#tzDeparture#<br> | |
#tzArrival# <br> | |
Duration Total Mins: #difference#<br> | |
Duration Hours: #int(difference/60)#<br> | |
Duration Mins: #difference MOD 60#<br> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment