Skip to content

# and #List functions date/timestamp encoding issue #32

Open

Description

@dansmith65

The # and #List functions encode dates in a specific local's format. If you attempt to read the encoded data on a file/system with a different local setting, it may fail with EvaluationError code 500.

This value was encoded in a new file on a computer set to display dates as YYYY-MM-DD:

"$ts = GetAsTimestamp ( \"2016-02-02 6:48:01 PM\" ) ;¶"

If I download this file and open it on the same computer, I get this result:

#Get ( "$ts = GetAsTimestamp ( \"2016-02-02 6:48:01 PM\" ) ;¶" ; "ts" ) = "?"
and
EvaluationError ( #Get ( "$ts = GetAsTimestamp ( \"2016-02-02 6:48:01 PM\" ) ;¶" ; "ts" ) ) = 500

I don't think this issue can be reproduced within a single file, which is probably why our current test cases haven't discovered it.

Activity

  1. petrowsky commented on Feb 4, 2016

    @petrowsky
    Collaborator

    Looks like you would need to have a file created from a different local
    and store it within a container and run tests against that file if you
    wanted to test it.

    On 2 Feb 2016, at 18:00, Dan Smith wrote:

    The # and #List functions encode dates in a specific local's format.
    If you attempt to read the encoded data on a file/system with a
    different local setting, it may fail with EvaluationError code 500.

    This value was encoded in a new file on a computer set to display
    dates as YYYY-MM-DD:

    "$ts = GetAsTimestamp ( \"2016-02-02 6:48:01 PM\" ) ;¶"
    

    If I download this
    file

    and open it on the same computer, I get this result:

    #Get ( "$ts = GetAsTimestamp ( \"2016-02-02 6:48:01 PM\" ) ;¶" ; "ts" 
    ) = "?"
    and
    EvaluationError ( #Get ( "$ts = GetAsTimestamp ( \"2016-02-02 6:48:01 
    PM\" ) ;¶" ; "ts" ) ) = 500
    

    I don't think this issue can be reproduced within a single file, which
    is probably why our current test cases haven't discovered it.


    Reply to this email directly or view it on GitHub:
    #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions