仅限日期 [英] date only

查看:67
本文介绍了仅限日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



为什么这个函数会返回日期和时间..我只希望日期为

返回..没时间就可以了:(

公共共享功能LastWorkDayOfTheMonth(ByVal dtmdate As Date)作为日期


Dim x As Date = LastDayOfTheMonthDate(dtmdate)


做IsWeekday(x)= False


x = x.AddDays(-1)


循环


返回x.Date


结束功能

Hi,
why does this function return the date and time.. I only want the date to
return.. no time on it :(
Public Shared Function LastWorkDayOfTheMonth(ByVal dtmdate As Date) As Date

Dim x As Date = LastDayOfTheMonthDate(dtmdate)

Do While IsWeekday(x) = False

x = x.AddDays(-1)

Loop

Return x.Date

End Function

推荐答案

" Brian S."< ; bs ******** @ community.nospamschrieb
"Brian S." <bs********@community.nospamschrieb



为什么这个函数会返回日期和时间。我只想要

日期返回..没时间就可以了:(

公共共享功能LastWorkDayOfTheMonth(ByVal dtmdate As Date)

日期


Dim x As Date = LastDayOfTheMonthDate(dtmdate)


Do WeWeekday(x)= False

>
x = x.AddDays(-1)


循环


返回x.Date


结束函数
Hi,
why does this function return the date and time.. I only want the
date to return.. no time on it :(
Public Shared Function LastWorkDayOfTheMonth(ByVal dtmdate As Date)
As Date

Dim x As Date = LastDayOfTheMonthDate(dtmdate)

Do While IsWeekday(x) = False

x = x.AddDays(-1)

Loop

Return x.Date

End Function



你传递给这个功能的是什么?价值来自哪里?

Armin

What do you pass to the function? Where does the value come from?
Armin


然后将其作为字符串返回

返回x.Date.ToString (dd-MM-yyyy)


Then return it as string
Return x.Date.ToString("dd-MM-yyyy")



我把它传给日期.....

#4/1/08#..当我按照代码一直到返回x.Date,

它仍然具有#4/31/08#格式,但在文本框包括12:00

" Armin Zingler" < az ******* @ freenet.dewrote in message

news:O%**************** @ TK2MSFTNGP05.phx.gbl ...
I pass it a date.....
#4/1/08#.. when I follow through the code all the way to the Return x.Date,
it still has the #4/31/08# format, but in the textbox it includes 12:00

"Armin Zingler" <az*******@freenet.dewrote in message
news:O%****************@TK2MSFTNGP05.phx.gbl...

" Brian S." < bs ******** @ community.nospamschrieb
"Brian S." <bs********@community.nospamschrieb

>
为什么这个函数会返回日期和时间..我只希望
日期返回..没有时间就可以了:(
公共共享功能LastWorkDayOfTheMonth(ByVal dtmdate As Date)
作为日期

Dim x As Date = LastDayOfTheMonthDate(dtmdate)

Is IsWeekday(x)= False

x = x.AddDays(-1)

Loop
结束函数
>Hi,
why does this function return the date and time.. I only want the
date to return.. no time on it :(
Public Shared Function LastWorkDayOfTheMonth(ByVal dtmdate As Date)
As Date

Dim x As Date = LastDayOfTheMonthDate(dtmdate)

Do While IsWeekday(x) = False

x = x.AddDays(-1)

Loop

Return x.Date

End Function



你传递给函数什么?值来自何处?


Armin


What do you pass to the function? Where does the value come from?
Armin



这篇关于仅限日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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