question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Description

This code is running over .Net but not Fable 2.

let dateString = "05/01/2008 +1:00"
let offsetDate = DateTimeOffset.Parse(dateString)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
Alxandrcommented, Jun 28, 2018

IMHO; the best way would be to only allow ISO dates YYYY-MM-DD (optionally with times). This could easily be enforced with a regex, and will always yield the same result. Will likely also prevent people from shooting themselves in the foot.

1reaction
Alxandrcommented, Dec 12, 2018

I agree. Also, the guid parsing will not be system specific.

On Wed, Dec 12, 2018, 02:09 Lukas Rieger <notifications@github.com wrote:

Yeah, its never easy.

My opinion would be to restrict to ISO dates here, because the rest isn’t guaranteed to work.

In the Guid case I would NOT follow ISO, because .NET doesn’t, Guid.Empty breaks, and I don’t think there are any failures from doing so.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fable-compiler/Fable/issues/1422#issuecomment-446423190, or mute the thread https://github.com/notifications/unsubscribe-auth/AAG2zkLsIhITWhGJBuWnkPls_R1-2t2kks5u4Fc1gaJpZM4UhdSY .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convert strings to DateTime
Learn techniques to parse strings that represent dates and times to create a DateTime from the date and time string.
Read more >
Parse string to DateTime in C# - Stack Overflow
DateTime.Parse() will try figure out the format of the given date, and it usually does a good job. If you can guarantee dates...
Read more >
C# DateTime.Parse: Convert String to ...
Dates from SQL. SQL date strings can be handed with DateTime.Parse. This is useful when you have database text-only data. DateTime.Parse works on...
Read more >
Date.parse() - JavaScript - MDN Web Docs
The Date.parse() static method parses a string representation of a date, and returns the date's timestamp. Only the date time string format is...
Read more >
DateTimeFormatter (Java Platform SE 8 )
The main date-time classes provide two methods - one for formatting, format(DateTimeFormatter formatter) , and one for parsing, parse(CharSequence text, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found