Skip to content

DateTimeZone.GetSystemDefault seems unuseful #61

@GoogleCodeExporter

Description

@GoogleCodeExporter
DateTimeZone.GetSystemDefault() warns that it can arbitrarily throw 
TimeZoneNotFoundException, and points to the null-coalescing operator and 
GetSystemDefaultOrNull() as a solution.

Given that, it seems that GetSystemDefault() isn't actually something you'd 
actually ever want to call.

We should probably support one pattern for getting the system-default time 
zone, rather than two that both need exceptional handling.

Quite how we do that, I'm not sure: perhaps provide 
GetSystemDefaultOrSomethingReasonable() [though I assume there are conditions 
under which there _is_ nothing reasonable?], or perhaps instead remove 
GetSystemDefaultOrNull() and make the conditions under which GetSystemDefault() 
can throw effectively ignorable (i.e. the "something's gone badly wrong" bucket 
rather than the "it turns out I don't support that" bucket).

Original issue reported on code.google.com by malcolm.rowe on 18 Apr 2012 at 8:54

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions