Replies Back to Article

Inserting and Diplaying the Regional Date Format correctly with Dreamweaver

Iso Date.
March 26, 2004 by Arjan Ruter

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

problem with time insert
April 2, 2004 by jack vermeulen

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

Great Code
October 10, 2005 by Carlos Leal
Thanks, it help me a lot...
Inserting Time
January 27, 2006 by Tom Theys

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
%>

Inserting time
August 5, 2008 by Pete Lister

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
'--