I found the ParseDateTime function but it only parses a date/time string according to the English (U.S.) locale conventions.
How to parse the date which is in dd/mm/yyyy format?
Try out this:
<cfset TestdateFrom = ParseDateTime("10/9/2010") />
<cfloop index="i" from="1" to="30" step="1">
<cfset TestdateFrom = DateAdd( "d", 1, TestdateFrom ) />
#TestdateFrom#<br/>
</cfloop>
In CF9 there is a LSParseDateTime function.
I don't know whether this will help me or not.
At last should I use java library for this issue?
Looks like this is working:
<cfset formatter = createObject("java","java.text.SimpleDateFormat")>
<cfset formatter.init("dd/MM/yyyy")>
<cfset newDate = formatter.parse("10/09/2010")>
#newDate#
Any other suggestions?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With