开发者

C# alternative for PHP function date('Y-m-d)

开发者 https://www.devze.com 2023-02-12 21:49 出处:网络
What\'s the easiest way to generat开发者_Python百科e a date string like in PHP with C#/.NET?DateTime date = DateTime.Now;

What's the easiest way to generat开发者_Python百科e a date string like in PHP with C#/.NET?


DateTime date = DateTime.Now;
Console.WriteLine(date.ToString("yy-MM-dd"));


String Format for DateTime C#

Custom Date and Time Format Strings

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号