Autodetect parse with seconds
See original GitHub issueHi,
I’m using Cronos inside application which read user configurations which could have standard minutes form or extended with seconds. Problem is, i do not know if user enter one or another and Parse()
method without second parameter throws Cronos.CronFormatException: Unexpected character '*'.
.
How should i detect if it is standard form or extended when Cronos can’t detect it by itself?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
java - Automatic Date/Time parser without specifying format
I am searching for a java library that can parse a string into a POJO without specifying the format. I have researched POjava....
Read more >Tika Auto Detect Parser
It calls the Parser.parse(InputStream, ContentHandler, Metadata, ParseContext) method with an empty ParseContext. Tika AutoDetectParser Example.
Read more >Using schema auto-detection | BigQuery
In the Google Cloud console, in the Schema section, for Auto detect, check the Schema and input parameters option. In the bq command-line...
Read more >How to Auto-Detect the Date/Datetime Columns and Set ...
Say I have a CSV data file that I want to read into a Pandas dataframe, and some of its columns are dates...
Read more >dateparser – python parser for human readable dates ...
dateparser provides modules to easily parse localized dates in almost any string formats commonly found on web pages. Documentation¶. This documentation is ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The
* * * * * *
expression is ambiguous – some parsers treat the first part as a second value, other parsers treat the first part as a minute, and last part as an year value – that’s why there’s no auto-detection mechanism in Cronos for this case.If your values only include seconds as a six-part expressions, then you can use the
String.Split
method to count the number of parts in a cron expression, and decide to use the corresponding format based on the result.@odinserj I wondered why cron does not include years for detecting special holidays or special open/closed periods that only exist in that specific year. This relates to cron expression used in Asterisk dialplans where you want to be closed in 2022 on the 10 of October. But the ambiguity with seconds is also something