You are almost certainly worrying about nothing. You're simply looking at what the date/time object returns when its toString
method is called, which ColdFusion uses to be able to output something on the screen (which needs to be string data). The various values you are looking at will all be completely valid date/time types, just different classes implement toString
differently. Your code will be dealing with the object, not the string representation of its value, so this is a non-issue.
Sounds like yer just outputting a raw value from either the DB result or the constructed query without formatting it, thus meaning CF needs to convert it to a string via its default toString
method, and as I say above the toString
methods vary from one DateTime implementation to another (the class of the object from the DB is different from the one CF uses for its own date objects, hence the different toString
implementations you're seeing). One should never do that if one cares about what is being output, as you are here. Always convert a DateTime object to a string yourself if you care about the format used to display it:
<cfoutput>#gGet.dateuploaded[1].dateTimeFormat("yyyy-mm-dd HH:nn:ss")#</cfoutput>
<cfoutput>#qReturn.deployDate[1].dateTimeFormat("yyyy-mm-dd HH:nn:ss")#</cfoutput>
(respectively, based on the info you've provided us).
This will return & display the date object values in the format you specify, rather than leaving it to CF to use its defaults.
Only do this for display. For any date operations just leave the things as-is. You're only perceiving there to be something "wrong" here because you don't understand that dates in CFML are objects not just human-readable strings. CF isn't - however - confused by this ;-)
I discuss this with more clarify (and taking up more space) in this article about date/time objects and their string representations, if you want to take a look.