Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why multiple statements? #23

Open
artknight opened this issue Jul 1, 2020 · 0 comments
Open

why multiple statements? #23

artknight opened this issue Jul 1, 2020 · 0 comments

Comments

@artknight
Copy link
Contributor

I just noticed this piece of code

public function epoch() hint="returns the number of milliseconds since 1/1/1970 (local). Call .utc() first to get utc epoch" {
  /*
        It seems that we can't get CF to give us an actual UTC datetime object without using DateConvert(), which we
        can not rely on, because it depends on the system time being the local time converting from/to. Instead, we've
        devised a system of detecting the target time zone's offset and using it here (the only place it seems necessary)
        to return the expected epoch values.
*/
    return this.clone().getDateTime().getTime() - this.utc_conversion_offset;
    var adjustment = (this.utc_conversion_offset > 0) ? -1 : 1;
    return this.clone().getDateTime().getTime();
    return this.clone().getDateTime().getTime() - (this.utc_conversion_offset * adjustment);
}

Only the first return will get executed! Why the other code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant