' Ger resultat: Måndag 25 Februari 2002
Function ConvertToSwedishLongDate(sDate)
dim iWeekDay
dim iDay
dim iMonth
dim iYear
dim str
iYear = Year(sDate)
iMonth = Month(sDate)
iDay = Day(sDate)
iWeekDay = Weekday(sDate)
select case iWeekDay
case vbSunday
str = "Söndag "
case vbMonday
str = "Måndag "
case vbTuesday
str = "Tisdag "
case vbWednesday
str = "Onsdag "
case vbThursday
str = "Torsdag "
case vbFriday
str = "Fredag "
case vbSaturday
str = "Lördag "
case else
str = " "
end select
str = str & iDay & " "
select case iMonth
case 1
str = str & "Januari "
case 2
str = str & "Februari "
case 3
str = str & "Mars "
case 4
str = str & "April "
case 5
str = str & "Maj "
case 6
str = str & "Juni "
case 7
str = str & "Juli "
case 8
str = str & "Augusti "
case 9
str = str & "September "
case 10
str = str & "Oktober "
case 11
str = str & "November "
case 12
str = str & "December "
case else
str = str & " "
end select
str = str & iYear
ConvertToSwedishLongDate = str
End Function
' Ger resultat: 2002-02-25 13:22
Function ConvertToSwedishDateTime(sDate)
dim iMinute
dim iHour
dim iWeekDay
dim iDay
dim iMonth
dim iYear
dim str
iYear = Year(sDate)
iMonth = Month(sDate)
iDay = Day(sDate)
iHour = Hour(sDate)
iMinute = Minute(sDate)
str = str & iYear & "-"
str = str & Right("0" & iMonth,2) & "-"
str = str & Right("0" & iDay,2) & " "
str = str & Right("0" & iHour,2) & ":"
str = str & Right("0" & iMinute,2)
ConvertToSwedishDateTime = str
End Function
' Ger resultat: Måndag 2002-02-25
Function ConvertToSwedishDayDate(sDate)
dim iMinute
dim iHour
dim iWeekDay
dim iDay
dim iMonth
dim iYear
dim str
iYear = Year(sDate)
iMonth = Month(sDate)
iDay = Day(sDate)
iHour = Hour(sDate)
iMinute = Minute(sDate)
iWeekDay = Weekday(sDate)
select case iWeekDay
case vbSunday
str = "Söndag "
case vbMonday
str = "Måndag "
case vbTuesday
str = "Tisdag "
case vbWednesday
str = "Onsdag "
case vbThursday
str = "Torsdag "
case vbFriday
str = "Fredag "
case vbSaturday
str = "Lördag "
case else
str = " "
end select
str = str & iYear & "-"
str = str & Right("0" & iMonth,2) & "-"
str = str & Right("0" & iDay,2)
ConvertToSwedishDayDate = str
End Function
' Ger resultat: 2002-02-25 13:26
Function ConvertToSwedishDateTime(sDate)
dim iMinute
dim iHour
dim iWeekDay
dim iDay
dim iMonth
dim iYear
dim str
iYear = Year(sDate)
iMonth = Month(sDate)
iDay = Day(sDate)
iHour = Hour(sDate)
iMinute = Minute(sDate)
iWeekDay = Weekday(sDate)
str = str & iYear & "-"
str = str & Right("0" & iMonth,2) & "-"
str = str & Right("0" & iDay,2) & " "
str = str & Right("0" & iHour,2) & ":"
str = str & Right("0" & iMinute,2)
ConvertToSwedishDateTime = str
End Function