where is LocalTime.TryParse*

56 views
Skip to first unread message

fschwiet

unread,
Mar 13, 2013, 12:01:24 AM3/13/13
to Noda Time
After looking at
http://noda-time.googlecode.com/hg-history/a3cc19dccea8ad2af0d426728588c3c854fe8e81/docs/userguide/text.html
and http://stackoverflow.com/questions/9402089/datetime-tryparse-for-only-a-time-parameter
I expected to find some Parse/TryParse methods on LocalTime or classes
like that. After downloading the latest nuget, prerelease and
otherwise, I could not find the methods. I feel like I'm going to
have an "oh duh" moment, but where would I find these methods?

Jon Skeet

unread,
Mar 13, 2013, 2:47:43 AM3/13/13
to Noda Time
You were looking at an old version of the user guide - use a LocalTimePattern instead:

LocalTimePattern pattern = LocalTimePattern.CreateWithInvariantCulture("HH:mm");
ParseResult<LocalTime> result = pattern.Parse("15:00");
if (result.Success)
{
    LocalTime time = result.Value;
    ...
}

See the 1.0 user guide or the current (unrelease) user guide for more info.

Jon




--

---
You received this message because you are subscribed to the Google Groups "Noda Time" group.
To unsubscribe from this group and stop receiving emails from it, send an email to noda-time+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages