• <label id="pxtpz"><meter id="pxtpz"></meter></label>
      1. <span id="pxtpz"><optgroup id="pxtpz"></optgroup></span>

        當(dāng)前位置:雨林木風(fēng)下載站 > 技術(shù)開(kāi)發(fā)教程 > 詳細(xì)頁(yè)面

        ASP.NET中處理datetime的一些通用函數(shù)

        ASP.NET中處理datetime的一些通用函數(shù)

        更新時(shí)間:2022-05-09 文章作者:未知 信息來(lái)源:網(wǎng)絡(luò) 閱讀次數(shù):

        'Uses the Timespan method to subtract a certain number of days
        Function Date1()
             Dim NewTime as DateTime
             NewTime = DateTime.Now.Subtract( New TimeSpan(7, 0, 0, 0) )
             NewTime = NewTime.Format("MM/dd/yyyy", DateTimeFormatInfo)
             response.write(NewTime)
        End Function

        'Uses the AddDays method to subtract X number of days
        Public Function Date2()
          Dim NewTime as DateTime
          NewTime = DateTime.Now.AddDays(-7)
          Dim s as string = NewTime
          return s
        End Function

        'Thanks to Paul Czywczynski for this idea
        'This probably (In My opinion) Offers the most flexibility found so far
        'Change where the MM/dd/yyyy to whatever
        'response.write(System.String.Format("{0:d}",NewTime))
        'would return just the name of the Day
        Function Date3()
          Dim NewTime as DateTime = now.addDays(-7)
          response.write(System.String.Format("{0:MM/dd/yyyy}",NewTime))
        End Function


        Function Date4()
        Dim NewTime as DateTime
          NewTime = now.addDays(-7)
          return NewTime.ToString()
        End Function

        'Uses the toLongTimeString method
        Public Function Date5()
          Dim NewTime as DateTime
          NewTime = Now()
          return newtime.toLongTimeString()
        End Function

        'Uses the toShortTimeString method
        Public Function Date6()
          Dim NewTime as DateTime
          NewTime = Now()
          return newtime.toShortTimeString()
        End Function

        'Uses the toLongDateString method
        Public Function Date7()
          Dim NewTime as DateTime
          NewTime = Now()
          return newtime.toLongDateString()
        End Function

        'Uses the toShortDateString method
        Public Function Date8()
          Dim NewTime as DateTime
          NewTime = Now()
          return newtime.toShortDatestring()
        End Function

        'Uses FormatDateTime function General format
        Function Date9()
          Dim NewTime as DateTime
          NewTime = DateTime.Now.Subtract( New TimeSpan(7, 0, 0, 0) )
          return formatdatetime(NewTime, 0)
        End Function

        'Uses FormatDateTime function LongDate format
        Function Date10()
          Dim NewTime as DateTime
          NewTime = DateTime.Now.Subtract( New TimeSpan(7, 0, 0, 0) )
          return formatdatetime(NewTime, 1)
        End Function

        'Uses FormatDateTime function ShortDate format
        Function Date11()
          Dim NewTime as DateTime
          NewTime = DateTime.Now.Subtract( New TimeSpan(7, 0, 0, 0) )
          return formatdatetime(NewTime, 2)
        End Function

        'Uses FormatDateTime function LongTime format
        Function Date12()
          Dim NewTime as DateTime
          NewTime = DateTime.Now.Subtract( New TimeSpan(7, 0, 0, 0) )
          return formatdatetime(NewTime, 3)
        End Function

        'Uses FormatDateTime function ShortTime format
        Function Date13()
          Dim NewTime as DateTime
          NewTime = DateTime.Now.Subtract( New TimeSpan(7, 0, 0, 0) )
          return formatdatetime(NewTime, 4)
        End Function

        'Bring Back just the name of the Day
        Function Date14()
          Dim NewTime as DateTime = now.addDays(-7)
          dim s as string
          s = (System.String.Format("{0:dddd}",NewTime))
          Return s
        End Function

        'Returns the Integer of what day of week
        Function Date15()
          Dim MyDate as DateTime
          Dim MyWeekDay as Integer
          MyDate = Now.AddDays(-5)
          MyWeekDay = Weekday(MyDate)   
          return MyWeekDay
        End Function

        'Returns the Month Integer
        Function Date16()
          Dim MyDate as DateTime
          Dim MyMonth as Integer
          MyDate = Now.AddDays(-5)
          MyMonth = Month(MyDate)   
          return MyMonth
        End Function

        'Returns just a formatted string
        'This method provides just formatting but
        'Very flexible with not a lot of code
        Function Date17()
          Dim MyDate as String
          MyDate = Format(Now(), "yyyy")
          return MyDate
        End Function
        </script>

        溫馨提示:喜歡本站的話(huà),請(qǐng)收藏一下本站!

        本類(lèi)教程下載

        系統(tǒng)下載排行

        主站蜘蛛池模板: 亚洲男同帅GAY片在线观看| 免费毛片在线看片免费丝瓜视频 | 男女午夜24式免费视频| 国产亚洲大尺度无码无码专线 | 亚洲色大成WWW亚洲女子| 国产免费看JIZZ视频| 亚洲an日韩专区在线| 男人的好看免费观看在线视频| 亚洲一级毛片在线播放| 最新猫咪www免费人成| 国产综合激情在线亚洲第一页 | 国产一精品一aⅴ一免费| 青青免费在线视频| 亚洲视频在线免费| 日本一区午夜艳熟免费| 亚洲美女视频网址| 日韩吃奶摸下AA片免费观看| 亚洲第一第二第三第四第五第六| 男女啪啪永久免费观看网站| 四虎一区二区成人免费影院网址| 国产亚洲视频在线播放| 麻豆高清免费国产一区| 亚洲精品永久在线观看| 亚洲 综合 国产 欧洲 丝袜| 免费观看一区二区三区| 亚洲国产精品日韩在线| 国产一级淫片视频免费看| 中文字幕免费视频精品一| 亚洲福利一区二区三区| 曰皮全部过程视频免费国产30分钟| 手机永久免费的AV在线电影网| 国产亚洲?V无码?V男人的天堂 | 亚洲美女大bbbbbbbbb| 午夜视频在线观看免费完整版| 免费无码AV一区二区| 亚洲国产高清人在线| 麻豆成人精品国产免费| 日韩免费高清播放器| 亚洲 欧洲 自拍 另类 校园| 亚洲伊人久久大香线蕉综合图片| 韩国免费一级成人毛片|