'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' GetRFC822Date ' Purpose: ' Gets date in the RFC 822 format (with 4-digit year) as required by the RSS ' 2.0 spec. ' Parameters: ' dtmDate - Date to format. ' Returns: ' Formatted date. ' Revisions: ' [tempus_rook@hotmail.com 2003-11-02] Code written. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function GetRFC822Date(dtmDate) ' XXX what about daylight savings? Dim strDate strDate = Left(WeekdayName(DatePart("w", dtmDate)), 3) & ", " & _ LeadingZero(DatePart("d", dtmDate)) strDate = strDate & _ " " & Left(MonthName(DatePart("m", dtmDate)), 3) & " " & _ DatePart("yyyy", dtmDate) & _ " " & LeadingZero(DatePart("h", dtmDate)) strDate = strDate & ":" & LeadingZero(DatePart("n", dtmDate)) & _ ":" & LeadingZero(DatePart("s", dtmDate)) & " GMT" GetRFC822Date = strDate ' Format: Sun, 02 Nov 2003 13:40:01 GMT
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' LeadingZero ' Purpose: ' Adds a leading zero to single digit numbers. ' Parameters: ' strText - Var to add a zero to, if necessary. ' Returns: ' Original text, with leading zero if required. ' Revisions: ' [tempus_rook@hotmail.com 2003-11-02] Code written. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function LeadingZero(strText) If Len(strText) = 1 Then LeadingZero = "0" & strText Else LeadingZero = strText End If End Function
dato = "01. august 2001" rfcDato = GetRFC822Date(Cdate(dato))
Ja det er det. Køre du med DK dato format på din server. Det er nok fordi den ikke kan gennemskue "01. august 2001" er en dato men den tror det en tekst.
dtmDate = "01. august 2001" dtmDate = replace(dtmDate,". januar ","-01-") dtmDate = replace(dtmDate,". februar ","-02-") dtmDate = replace(dtmDate,". marts ","-03-") dtmDate = replace(dtmDate,". april ","-04-") dtmDate = replace(dtmDate,". maj ","-05-") dtmDate = replace(dtmDate,". juni ","-06-") dtmDate = replace(dtmDate,". juli ","-07-") dtmDate = replace(dtmDate,". august ","-08-") dtmDate = replace(dtmDate,". september ","-09-") dtmDate = replace(dtmDate,". oktober ","-10-") dtmDate = replace(dtmDate,". november ","-11-") dtmDate = replace(dtmDate,". december ","-12-") dtmDate = Cdate(dtmDate)
Så har du datoen som dd-mm-yyyy så kan du prøve med funktionen.
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.