anusha
asked on
cffunction about converting time
All,
I have the following
<cffunction name="getTime">
<cfargument name="mysec" type="numeric" required="true">
<cfset timesec = mysec mod 60>
<cfset timemin = ((mysec - timesec) mod 3600) / 60>
<cfset timehour = (mysec - (timemin*60)) / 3600>
<cfreturn createtime(timehour, timemin, timesec)>
</cffunction>
The input para sometimes has trouble passing "createtime(timehour, timemin, timesec)> "
how do I not get an error if the following fails.
<cfset #ct# = #LSTimeFormat(gettime(ev_c time),'hh: mm tt')#>
how do I need to modify the fn to get null output if the createtime fails.
Thanks
I have the following
<cffunction name="getTime">
<cfargument name="mysec" type="numeric" required="true">
<cfset timesec = mysec mod 60>
<cfset timemin = ((mysec - timesec) mod 3600) / 60>
<cfset timehour = (mysec - (timemin*60)) / 3600>
<cfreturn createtime(timehour, timemin, timesec)>
</cffunction>
The input para sometimes has trouble passing "createtime(timehour, timemin, timesec)> "
how do I not get an error if the following fails.
<cfset #ct# = #LSTimeFormat(gettime(ev_c
how do I need to modify the fn to get null output if the createtime fails.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
logic like this :
<cftry>
<cfset ct = LSTimeFormat(gettime(ev_ct
<cfcatch>
<cfset ct = "">
</cfcatch>
</cftry>