• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

how can ı take time for yyyyMMddHHmmss format?

Explorer ,
Aug 17, 2020 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

238

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
community guidelines
Explorer ,
Aug 17, 2020 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....

Iambradb.com Adobe ColdFusion Specialist.

Votes

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
community guidelines
Community Expert ,
Aug 18, 2020 Aug 18, 2020

Copy link to clipboard

Copied

LATEST

 

<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>

 

 

 

Votes

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
community guidelines
Resources
Documentation