Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dates

Status
Not open for further replies.

tobyheywood

IS-IT--Management
Apr 20, 2001
122
GB
Does anyone know know how I can get the following date format, and for that matter if it's not does anyone know if it is going to be included in future releases of OpenOffice?

I want a date like Friday 31st December 1999 but at the moment all I can get is Friday 31 December 1999. This is obviously auto updating field but any suggestions would be nice.

Thanks in advance.

Regards

Toby Heywood
 
You could try the following macro:

-------------------------------------
[tt]function fulldate(dt as date) as string
dim d as integer
dim ord as string
d=day(datevalue(dt))
if d=1 or d=21 or d=31 then
ord="st"
else
if d=2 or d=22 then
ord="nd"
else
if d=3 or d=23 then
ord="rd"
else ord="th"
end if
end if
end if
dim days(1 to 7) as string
days(1)="Sunday"
days(2)="Monday"
days(3)="Tuesday"
days(4)="Wednesday"
days(5)="Thursday"
days(6)="Friday"
days(7)="Saturday"
dim months(1 to 12) as string
months(1)="January"
months(2)="February"
months(3)="March"
months(4)="April"
months(5)="May"
months(6)="June"
months(7)="July"
months(8)="August"
months(9)="September"
months(10)="October"
months(11)="November"
months(12)="December"
fulldate=days(weekday(datevalue(dt))) & " " & d & ord & " " & months(month(datevalue(dt))) & " " & year(datevalue(dt))
end function[/tt]
---------------------------------------------

Then, when you use the formula =FULLDATE(...) you will get the supplied date formatted as you specified.

Tony Groves.

P.S. The text starting with "fulldate=" and ending with "year(datevalue(dt))" should be all on one line.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top