开发者

int to string to date

i use asp.net

i have a int (10112009)

in the end i want a date formate like day- day / month month / yyyy

what's the b开发者_如何学Cest way (or a way) to do that?

thanks


I would do something like this:

int n = 10112009;
DateTime date;
if (DateTime.TryParseExact(n.ToString("00000000"), "ddMMyyyy", 
        CultureInfo.InvariantCulture, DateTimeStyles.None, out date))
{
    // use date
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜