docs
docs copied to clipboard
Small issue or unclear part in TimeSpan example
In the second code snippet of the TimeSpan structure section, the example output says the store is closed at 21:00 when the store closing time is 21:30 and there is no indication of the local timezone being different from the store timezone.
Suggested solution is one or both of the following:
- Print local timezone or offset in output to indicate whether it is different from the timezone or offset of the store
- If the timezone is supposed to be the same in the example, change the "Store is open at 21:00:00: False" line to True because the store closing time is defined as 21:30
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 7b64d1f3-174c-fffe-d2e6-59a0b62de797
- Version Independent ID: 832e5ebc-6fc0-e596-5827-51034a3f89ab
- Content: Choosing between DateTime, DateTimeOffset, TimeSpan, and TimeZoneInfo
- Content Source: docs/standard/datetime/choosing-between-datetime.md
- Product: dotnet
- Technology: dotnet-standard
- GitHub Login: @Thraka
- Microsoft Alias: adegeo
I suppose this should have been in the samples repository.
@TheRealMaxion No, this is the correct place. The snippet code may live in that repo but the issue is related to the published article.
Thank you for opening this issue. I think the code should be updated to indicate the timezones and then also indicate on the output of the is open check, that this is based on your timezone.
Console.WriteLine($"Store is in timezone {store103.tz} and you are in timezone {TimeZoneInfo.Local}");
Console.WriteLine($"Store is open in your timezone at {time}: {store103.IsOpenAt(time)}");
This issue has been closed as part of the issue backlog grooming process outlined in #22351.
That automated process may have closed some issues that should be addressed. If you think this is one of them, reopen it with a comment explaining why. Tag the @dotnet/docs
team for visibility.
This is still an issue, though the other lines in the example for what other times the store are closed imply that the user doing the checking is located in the PST timezone, there is no explicit information or definition of this given, and therefore the output of the example looks wrong.
Also it seems that I do not have access to reopen the issue. @Thraka can you do it?
Thanks @TheRealMaxion I'll reopen.
Thank you @BillWagner