Replies Back to Article
Inserting and Diplaying the Regional Date Format correctly with Dreamweaver
Nice code to convert the date to IsoDate. It solves my problem, but I also use a price field in my form and after the Update record behaviour, the price has changed to a number I don't want. Is it difficult to skip certain form fields?
Arjan
Great code but i have a insert field for inserting a time. The time isnt put in the database and gives as result 0:00:00.
I hope you got a solution for that.
Thanks,
Jack
I want to insert and edit day, month, year and time.I tried this but it gives the message: Wrong number of arguments or invalid property assignment: 'Time'
<%
Function IsoDate(dteDate)
'Version 1.0 by Giuliano Sauro
If IsDate(dteDate) = True Then
DIM dteDay, dteMonth, dteYear, dteTime
dteDay = Day(dteDate)
dteMonth = Month(dteDate)
dteYear = Year(dteDate)
dteTime = Time(dteDate)
IsoDate = dteYear & _
"-" & Right(Cstr(dteMonth + 100),2) & _
"-" & Right(Cstr(dteDay + 100),2) & _
" " & dteTime
Else
IsoDate = Null
End If
End Function
%>
strip the time out then add it back in later
<%
Function IsoDate(ReqdteDate)
'Version 1.0 by Giuliano Sauro
dtedate="left"(ReqdteDate,10)
dtetime="right"(ReqdteDate,9)
If IsDate(dteDate) = True Then
DIM dteDay, dteMonth, dteYear
dteDay = Day(dteDate)
dteMonth = Month(dteDate)
dteYear = Year(dteDate)
IsoDate = dteYear & _
"-" & Right(Cstr(dteMonth + 100),2) & _
"-" & Right(Cstr(dteDay + 100),2) & dteTime
Else
IsoDate = Null
End If
End Function%>
'--convert date to ISO date-format
If IsDate(left(MM_fields(MM_i+1),10)) Then
MM_fields(MM_i+1) = IsoDate(MM_fields(MM_i+1))
End If
'--