Issues
- getTimezone function not compatible with CFLDEV-4019Resolved issue: LDEV-4019Pothys - MitrahSoft
- getTimeZoneInfo() is missing the "timezone" that Adobe CF hasLDEV-3902Resolved issue: LDEV-3902Pothys - MitrahSoft
- cfQuery is not Threadsafe! [pageContext / TimeZone]LDEV-3591
- ACF2021 - add function ClearTimeZoneLDEV-3147Resolved issue: LDEV-3147
- Datasources defined in Application.cfc always get a timezone setLDEV-2902Resolved issue: LDEV-2902Pothys - MitrahSoft
- GetTimeZoneInfo() include SHORT display name in results, i.e. PSTLDEV-2126Resolved issue: LDEV-2126Michael Offner
- Cannot create MySQL DatasourceLDEV-1780Resolved issue: LDEV-1780Michael Offner
- Default timezone for cfqueryLDEV-391Resolved issue: LDEV-391Michael Offner
getTimezone function not compatible with CF
Description
Environment
Attachments
Details
Assignee
Pothys - MitrahSoftPothys - MitrahSoftReporter
Adam CameronAdam CameronPriority
TrivialFix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Details
Details
Assignee
Reporter
Priority
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Activity
Michael Offner30 April 2024 at 16:02
added test case
Pothys - MitrahSoft30 April 2024 at 15:53
I've checked this ticket with Lucee latest version 6.0.2.29-SNAPSHOT.Now this issue seems to be resolved. So, I added a testcase for this ticket.
Here's the PR (6.0) :
Michael Offner30 April 2024 at 13:32Edited
Lucee 6.0
i added support that a timeZone can be handled as struct, take the following example code ( can you please create a test case out of this):
gives me this output now:
As you simply dump it gives you a struct like output, but it uses the colors for simple values (red) and has “TimeZone“ in the label.
Next converting it to a string, still works exactly the same way.
then i address a key directly and i can also loop through it like a struct.
“ds Füfi u Wegli”
Michael Offner30 April 2024 at 12:45
setTimeZone already accepts all kind of info as input, timezone names, labels and ids
in ACF the function GetTimeZoneInfo()
is identical to GetTimeZone()
in Lucee they differ, the Lucee GetTimeZoneInfo()
is identical to ACF (gives a bit more info), but as this ticket points out, GetTimeZone()
differs. Good thing is that the function does not return a string, instead it return a TimeZone object, what Lucee natively support as a simple value.
Take this example
as you can see, because we have a timezone object, we can have some fun with it and allow Lucee to handle it as a struct if needed. that would bring ACF compatibility without changing the current behaviour, but because we already have a simple workaround for this by simply using GetTimeZoneInfo()
, we only will address this, if it can be done with low effort.
Zac Spitzer9 June 2022 at 16:17Edited
if we ever go down this path, we could also extend setTimeZone
to accept a struct and (attempt) to read the id
/ timezone
value
CF:
Lucee:
I don’t doubt that this is because “Lucee added it first”. But… it’s a lesson in “don’t add stuff to CFML cos it’s not your language”. Just copy CF, once they decide how they intend to handle things. Lucee adding functions before CF does doesn’t help anyone, and too often results in situations like this.
“Bug” because it’s a design bug to go off-piste with the CFML language IMO.