隨筆-3  評論-26  文章-41  trackbacks-0
          '將一個一位的數字前面加零
          function FillZero(str)
             ttt
          =str
             
          if len(str)=1 then
                ttt
          ="0" & str
             
          end if
             FillZero
          =ttt
          end function

          '轉化日期,將 一位補上零  2003-1-2  -->  2003-01-02
          function ConvertDate(tDate)
             ttt
          =tDate
             
          if isdate(tDate) then
                ttt
          =year(tDate) & "-" & FillZero(month(tDate)) & "-" & FillZero(day(tDate))
             
          end if
             ConvertDate
          =ttt
          end function

          '輸入一個日期時間串,轉換成年四位,其他兩位的新的日期時間串
          function ConvertDateTime(tDateTime)
             ttt
          =tDateTime
             
          if isdate(tDateTime) then
                ttt
          =year(tDateTime) & "-" & FillZero(month(tDateTime)) & "-" & FillZero(day(tDateTime)) & " " & FillZero(cstr(hour(tDateTime))) & ":" & FillZero(cstr(minute(tDateTime))) & ":" & FillZero(cstr(second(tDateTime)))
             
          end if
             ConvertDateTime
          =ttt
          end function
          posted on 2007-11-21 22:14 百年 閱讀(259) 評論(0)  編輯  收藏 所屬分類: Asp Article
          主站蜘蛛池模板: 太谷县| 乐清市| 翁牛特旗| 平潭县| 阿坝| 米泉市| 萨嘎县| 县级市| 体育| 普洱| 日喀则市| 怀集县| 荆门市| 晋中市| 佛冈县| 兴安县| 武清区| 阳春市| 元朗区| 遂平县| 和硕县| 安远县| 凤凰县| 承德市| 虹口区| 桐乡市| 肇庆市| 康马县| 格尔木市| 广昌县| 黄冈市| 云浮市| 和平县| 古蔺县| 六盘水市| 确山县| 沈阳市| 临汾市| 阿瓦提县| 石泉县| 万年县|