Skip to content

Commit

Permalink
Add time zone information for ColdFusion
Browse files Browse the repository at this point in the history
  • Loading branch information
lulunac27a committed Jul 25, 2024
1 parent 640afa7 commit 8063ef4
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions datetime-coldfusion/datetime.cfm
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ Enter date and time values
<body>
<cfset dateAndTimeNow = now()><!---set input form values to current date and time--->
<cfset dateAndTimeNowUtc = dateConvert("local2Utc", dateAndTimeNow)>
<cfset currentTimeZone = GetTimeZoneInfo()><!---get current time zone--->
<cfform method = "post"><!---send post request when form is submitted--->
Year:
<cfinput type = "text" id = "year" name = "year" value = "#Year(dateAndTimeNow)#"
@@ -250,6 +251,30 @@ Enter date and time values
</span>
</cfoutput>
<br>
<cfoutput>
Current Time Offset in Seconds from UTC:
<span id = "output">#currentTimeZone.utcTotalOffset#
</span>
</cfoutput>
<br>
<cfoutput>
Current Time Offset in Hours:
<span id = "output">#currentTimeZone.utcHourOffset#
</span>
</cfoutput>
<br>
<cfoutput>
Current Time Offset in Minutes:
<span id = "output">#currentTimeZone.utcMinuteOffset#
</span>
</cfoutput>
<br>
<cfoutput>
Current DST Value:
<span id = "output">#currentTimeZone.isDSTOn#
</span>
</cfoutput>
<br>
<!---output the current UTC date and time in all supported formats--->
<cfoutput>
Current UTC Day of Month:

0 comments on commit 8063ef4

Please sign in to comment.