Issues

Select view

Select search mode

 

getTimezone function not compatible with CF

Won't Fix

Description

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.

Environment

None

Attachments

1

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

Created 3 June 2022 at 14:02
Updated 23 January 2025 at 17:25
Resolved 8 June 2022 at 11:24

Activity

Show:

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:32
Edited

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:17
Edited

if we ever go down this path, we could also extend setTimeZone to accept a struct and (attempt) to read the id / timezone value

Flag notifications