隨筆-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 百年 閱讀(262) 評論(0)  編輯  收藏 所屬分類: Asp Article
          主站蜘蛛池模板: 诸暨市| 阿图什市| 慈利县| 炎陵县| 绥阳县| 襄汾县| 久治县| 河间市| 安阳县| 蒲江县| 喀喇沁旗| 清水河县| 东明县| 田林县| 双峰县| 青川县| 景德镇市| 萍乡市| 磴口县| 赫章县| 自治县| 南城县| 巴林左旗| 七台河市| 澄江县| 芜湖县| 康定县| 巴楚县| 聂拉木县| 平邑县| 康平县| 乃东县| 杨浦区| 宁明县| 莫力| 保定市| 盘锦市| 阜南县| 开封市| 沂源县| 福建省|