Skip to content

Instantly share code, notes, and snippets.

@Likk
Created August 28, 2019 06:09
Show Gist options
  • Save Likk/ee121a8b6001059ec0502696b38293b6 to your computer and use it in GitHub Desktop.
Save Likk/ee121a8b6001059ec0502696b38293b6 to your computer and use it in GitHub Desktop.
ColdFusion で日付処理
<cfset localDate = now()>
<cfset utcDate = DateConvert("Local2utc", localDate)>
<cfset epoch = DateDiff("s", "January 1 1970 00:00", utcDate)>
<cfset utime = 1371729285>
<cfoutput>
Local Date: #localDate# <br>
UTC Date: #utcDate# <br>
Epoch: #epoch# <br>
Time :#DateAdd("s", utime ,DateConvert("utc2Local", "January 1 1970 00:00"))# <br>
yymmdd24hmiss: #DateFormat(localDate, "yyyy/MM/dd")# #TimeFormat(localDate, "HH:mm:ss")#
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment