DateFormat(Now(),"YYYYMMDD") is returning 9 characters instead of 8.
Problem Description: DateFormat is returning a 9 character date instead of an 8 character one.
Steps to Reproduce:
1. Add the following to any Cold Fusion page:
<cfset testDate = DateFormat(Now(),"YYYYMMDD")>
<cfoutput>
Current Now(): #Now()#<br>
Test DateFormat: [#testDate#] (Length: #Len(testDate)#)<br>
</cfoutput>
Actual Result:
Current Now(): {ts '2025-07-08 13:57:51'}
Test DateFormat: [202507189] (Length: 9)
Expected Result:
Current Now(): {ts '2025-07-08 13:57:51'}
Test DateFormat: [20250708] (Length: 😎
Any Workarounds: I checked my system clock and it is indeed set to 7/8/2025 (today) so I know it's not the system clock. I also updated Cold Fusion 2023 to the latest update(15) and restarted the server but it didn't help, I still get the same error.
Browser Info: Chrome
-----------------
System Information
------------------
Time of this report: 7/8/2025, 14:04:50
Machine name: ITJN-JHTSY84
Machine Id: {921ECBB9-6C70-4E25-A872-0A8995BFE289}
Operating System: Windows 10 Enterprise 64-bit (10.0, Build 19045) (19041.vb_release.191206-1406)
Language: English (Regional Setting: English)
System Manufacturer: Dell Inc.
System Model: Precision 5860 Tower
BIOS: 2.10.0 (type: UEFI)
Processor: Intel(R) Xeon(R) w3-2423 (12 CPUs), ~2.1GHz
Memory: 65536MB RAM
Available OS Memory: 64768MB RAM
Page File: 25886MB used, 48097MB available
Windows Dir: C:\windows
DirectX Version: DirectX 12
DX Setup Parameters: Not found
User DPI Setting: 96 DPI (100 percent)
System DPI Setting: 96 DPI (100 percent)
DWM DPI Scaling: Disabled
Miracast: Available, no HDCP
Microsoft Graphics Hybrid: Not Supported
DirectX Database Version: 1.0.8
DxDiag Version: 10.00.19041.5794 64bit Unicode
2023,0,15,330825
