Highlighted

how can ı take time for yyyyMMddHHmmss format?

Explorer ,
Aug 17, 2020

Copy link to clipboard

Copied

ı wrote a report at coldfsuion.now ı must sent old information to other company but at sql it is hide '20200817' now ı must add it HHmmss too.how can ı change all data at sql?ı can add random time too.

what will ı add not important but ı must turn all data that format  "yyyyMMddHHmmss" anybody have any idea?

Views

43

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

how can ı take time for yyyyMMddHHmmss format?

Explorer ,
Aug 17, 2020

Copy link to clipboard

Copied

ı wrote a report at coldfsuion.now ı must sent old information to other company but at sql it is hide '20200817' now ı must add it HHmmss too.how can ı change all data at sql?ı can add random time too.

what will ı add not important but ı must turn all data that format  "yyyyMMddHHmmss" anybody have any idea?

Views

44

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 17, 2020 0
Explorer ,
Aug 17, 2020

Copy link to clipboard

Copied

in coldfusion you can use dateTimeFormat (date [, mask])

go here for info on how to use https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-c-d/DateTimeFormat....

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 17, 2020 1
BKBK LATEST
Adobe Community Professional ,
Aug 18, 2020

Copy link to clipboard

Copied

 

<cffunction name="formatDatetime" returntype="string">	
	
	<!---Default: current date --->
	<cfargument name="yr" default="#year(now())#">
	<cfargument name="month" default="#month(now())#">
	<cfargument name="day" default="#day(now())#">	
	
	<cfargument name="hr" default="0">
	<cfargument name="min" default="0">
	<cfargument name="sec" default="0">
	
	<!--- Construct the datetime from the input --->
	<cfset var dateTime=createDatetime(arguments.yr, arguments.month, arguments.day, arguments.hr, arguments.min, arguments.sec)>
	
	<!--- Express the datetime in the string format yyyyMMddHHmmss (Note: in ColdFusion, nn denotes minutes)--->
	<cfset var formattedDatetime=datetimeFormat(dateTime, "yyyyMMddHHnnss")>
	
	<cfreturn formattedDatetime>
	
</cffunction>

<cfoutput>
<h4>Datetimes in yyyyMMddHHmmss format:</h4>
Default	datetime (current): #formatDatetime()# <br>
21st March 2019 15:46:07 : #formatDatetime(2019,3,21,15,46,7)#
</cfoutput>

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 18, 2020 0