日期:2014-05-18  浏览次数:20392 次

字符串格式化成日期问题
达到如下目的
<script   runat= "server ">

Dim   date1   As   DateTime   =   DateTime.Now
dim   DateLimit1   as   datetime   =   date1.year()& "- "&date1.month()& "-1 "
dim   DateLimit2   as   datetime   =   date1

DateLimit_1   =   DateLimit1   &   "   00:00:00 "
DateLimit_2   =   DateLimit2   &   "   23:59:59 "

提示
行   13:   dim   DateLimit2   as   datetime   =   date1
行   14:  
行   15:   DateLimit_1   =   DateLimit1   &   "   00:00:00 "
行   16:   DateLimit_2   =   DateLimit2   &   "   23:59:59 "
行   17:  
 

源文件:   D:\wwwroot\yuangongyingxiao8882\dc_default.aspx         行:   15  

请问该如何实现?说实话,有电懒了

------解决方案--------------------
Dim date1 As DateTime = DateTime.Now
Dim DateLimit1 As DateTime = date1.Year() & "- " & date1.Month() & "-1 "
Dim DateLimit2 As DateTime = date1

Dim DateLimit_1 As String = DateLimit1.ToString( "yyyy-MM-dd ") & " 00:00:00 "
Dim DateLimit_2 As String = DateLimit2.ToString( "yyyy-MM-dd ") & " 23:59:59 "