输入数字并获取月份和日期 [英] input number and get month and day

查看:71
本文介绍了输入数字并获取月份和日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Visual Basic 6.0或Visual Studio 2010中进行制作
(输入数字并获取月份和日期)

how to make it in visual basic 6.0 or Visual studio 2010
(input number and get month and day )

推荐答案

尝试:
Dim dt As New DateTime(2001, 1, 1)
dt = dt.AddDays(145)
Console.WriteLine(dt.ToString("M"))


您可能要使用当前年份,并且可能要进行一些错误检查.


You probably want to use the current year, and you probably want to do some error checking.


您可以使用TryParse()方法将字符串转换为日期和时间

You can use TryParse() method to convert string to date and time

DateTime.TryParse(string,out DateTime)


检查下面的链接

http://msdn.microsoft.com/en-us/library/ch92fbc1.aspx [ ^ ]


Check the link below

http://msdn.microsoft.com/en-us/library/ch92fbc1.aspx[^]


这篇关于输入数字并获取月份和日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆