guest
|
Posted: 06/10/2002, 1:42 PM |
|
Pls advise simplest way to format a date field for UK dd/mm/yyyy format. (ASP).
TIA
Jay Ratansi
|
|
|
Alexey Alexapolsky
|
Posted: 06/13/2002, 6:56 AM |
|
Make sure that given format is specified in your database.
Regional settings may affect it as weel. Here are functions
that may help you with it if you use SQL Server
Use form properties where you want to use date/time and formatting;
pick events.
Open event - ASP and Wrap checked
Dim CurrMonth, CurrDay, CurrYear, CurrDate
CurrMonth = Month(Date())
if Len(CurrMonth )=1 Then CurrMonth = "0" & CurrMonth
CurrDay = Day(Date())
if Len(CurrDay )=1 Then CurrDay = "0" & CurrDay
CurrYear = Year(Date())
CurrDate = CurrYear & "/" & CurrMonth & "/" & CurrDay
then in the Before Show/Before Insert/Before Update events:
If IsDate(fldGEBURTSDATUM) Then
fldGEBURTSDATUM = DatePart("yyyy", fldGEBURTSDATUM) & "-" & DatePart("m",
fldGEBURTSDATUM) & "-" & DatePart("d", fldGEBURTSDATUM)
End If
If IsDate(fldENTLASSUNGSTERMIN) Then
fldENTLASSUNGSTERMIN = DatePart("yyyy", fldENTLASSUNGSTERMIN) & "-" &
DatePart("m", fldENTLASSUNGSTERMIN) & "-" & DatePart("d",
fldENTLASSUNGSTERMIN)
End If
If IsDate(fldERFDATUM) Then
fldERFDATUM = DatePart("yyyy", fldERFDATUM) & "-" & DatePart("m",
fldERFDATUM) & "-" & DatePart("d", fldERFDATUM)
End If
--
Alex
CodeCharge Developer
<info@sonal.co.uk> wrote in messagenews:ae330b$k2j$1@news.codecharge.com...
> Pls advise simplest way to format a date field for UK dd/mm/yyyy format.
(ASP).
>
> TIA
>
> Jay Ratansi
>
>
|
|
|
|