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

Bug report: Parse Date and Time and Translate Date and Time recipe loading errors #1121

Open
mattnotmax opened this issue Nov 2, 2020 · 5 comments · May be fixed by #1136
Open

Bug report: Parse Date and Time and Translate Date and Time recipe loading errors #1121

mattnotmax opened this issue Nov 2, 2020 · 5 comments · May be fixed by #1136
Labels

Comments

@mattnotmax
Copy link
Contributor

Describe the bug
Both Parse DateTime and Translate DateTime have a default input date and time of DD/MM/YYYY HH:mm:ss.

If the user loads a recipe with a different input (e.g. YYYY-MM-DD HH:mm:ss) this will be ignored and the original DD/MM/YYYY HH:mm:ss will be used instead.

Duplicate of #646 but this issue also includes the Parse DateTime operation which is also affected.

To Reproduce

Load the following recipe:

[{"op":"Parse DateTime","args":["Standard date and time","YYYY-MM-DD HH:mm:ss.SSSSSS","UTC"]}]

The default input will be DD/MM/YYYY HH:mm:ss and not YYYY-MM-DD HH:mm:ss.SSSSSS

Expected behaviour
The input should be the value from the recipe.

Thanks! Please keep up the good work.

@mattnotmax mattnotmax added the bug label Nov 2, 2020
@mt3571
Copy link
Contributor

mt3571 commented Nov 27, 2020

Setting the Built-in format to Automatic lets you get around this issue, for example here is a custom input format.

@mattnotmax
Copy link
Contributor Author

Thanks @mt3571 that's a good workaround; however, I still see it as unintended behaviour and a bug.

Both operations default to Standard Date and Time and it's unintuitive to have to switch the Built in formats to Automatic to make the saved recipe work. A user is likely to leave the built in format alone and simply adjust their input string directly if they have a bespoke date and time.

@mt3571
Copy link
Contributor

mt3571 commented Nov 30, 2020

I see your point. I think however that if you have selected Standard Date and Time then it isn't unexpected behaviour for the Input format string to be populated with the standard format. Perhaps the solution is to change the default format to Automatic or to rename it to something that makes it more clear about what it does?

The reason this behaviour is occurring is because the Built in format is set to auto-populate the field below it. The issue with changing this behaviour (as in taking the format from the URL) is that it also raises questions/issues about what should happen if the user has entered a custom format but then changes the type.

@mattnotmax
Copy link
Contributor Author

I guess because Standard Date and Time is the default, I usually just leave it alone and enter the required format. My issue is that you only realise that its "broken" after you save the script and then wonder why its not working. Worse if you are sharing the script with someone who is not savvy with CyberChef and expects it to work.

Perhaps it's better to have a 'Custom' entry that is default with the Input Format String blank. Then leave Standard Date and Time in the drop down for the user to deliberately choose.

This will solve the auto-populate option and make it clearer to the user.

Thanks for explaining the underlying issue!

@mt3571
Copy link
Contributor

mt3571 commented Nov 30, 2020

Yes I agree, I think this would be a good solution. I can (hopefully) submit a fix for this now 😄

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

Successfully merging a pull request may close this issue.

2 participants