LotusScript Class WordDate in the Word file

xiaoxiao2021-03-06  111

% Rem @Author: Snowdot23

@Time: 2004-1-10 @Description: and LotusScript Operating Word files related to the class; formatted date% END REM

Class wordDate dateString As String starts As String stops As String Sub new (s As String) dateString = s Call splitString () End Sub Public Function getFormatDate (st As String) std = formatString (st) std = formatString1 (st) getFormateDate = std End Function Public Function getStartDate () starts = formatString (starts) getStartDate = starts End Function Public Function getStopDate () stops = formatString (stops) getStopDate = stops End Function Private Sub splitString () Dim ins As Integer ins = Instr (datestring, " ~ ") IF INS> 0 THEN STARTS = LEFT (DateString, INS-1) Stops = Right (DateString, Len (DateString) -ins" stops = formatstring (stops) Else Starts = FormatString (Starts) starts = formatString1 (starts) End If End Sub Function formatString (st As String) formatString = Replace (st, "/", "-") End Function Function formatString1 (st As String) formatString1 = Replace (st,, "." "-") endyear = left (st, 4) end functioni On Function GETMONTH (ST AS STRING) DIM RES AS STRING DIM TEMP AS STRING TEMP = Right (ST, LEN (ST) -4) DIM TEMP1 AS STRING TEMP1 = Left (TEMP, 1) IF TEMP1 = "/" OR TEMP1 = "." Temp1 = Right (Temp, LEN (ST) -5) res = left (Temp1, 2) Else Res = Left (Temp, 2) endiff function getDay (st as string) getday = Right (ST, 2) End FunctionEND CLASS

转载请注明原文地址:https://www.9cbs.com/read-125189.html

New Post(0)