Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trycf/c6ab999a8ad28239d4fc1da223e1aa66 to your computer and use it in GitHub Desktop.
Save trycf/c6ab999a8ad28239d4fc1da223e1aa66 to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
function assert( actual, expected ) {
if ( expected == actual ) {
writeOutput( "✔" )
} else {
writeOutput( "✗" )
}
writeOutput( " expected `#expected#`, got `#actual#`<br>" );
}
todayDate = createDateTime(2024, 4, 7, 23, 45, 59, 999);
assert( dayofweek(todayDate), 1 );
assert( dayofyear(todayDate), 98);
assert( daysinmonth(todayDate), 30 );
assert( daysinyear(todayDate), 366 );
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment