Skip to content

Parsing string to DateOnly object #27562

@shahabfar

Description

@shahabfar

Type of issue

Other (describe below)

Description

Introducing new DateOnly and TimeOnly structs by .NET 6 it seems that Parsing string to DateOnly object could be added to this doc

string dateInput = "December 15, 2021";
var parsedDate = DateOnly.Parse(dateInput);
Console.WriteLine(parsedDate);
// Displays the following output on a system whose culture is en-US:
//       12/15/2021

Page URL

https://learn.microsoft.com/en-us/dotnet/standard/base-types/parsing-datetime

Content source URL

https://github.com/dotnet/docs/blob/live/docs/standard/base-types/parsing-datetime.md

Document Version Independent Id

ab45c18d-53e8-c4df-0739-ce4d671fb57b

Article author

adegeo

Metadata

  • ID: c63f31e2-886a-e99b-bac1-71264b5d724f
  • Service: dotnet-fundamentals

Metadata

Metadata

Assignees

Labels

dotnet-fundamentals/svcin-prThis issue will be closed (fixed) by an active pull request.

Type

No type

Projects

Status

🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions