This topic is locked

Date & Time

3/3/2007 9:54:51 AM
ASPRunnerPro General questions
M
Michael7 author

Hi,

  1. I have used the Now() function in a field called Last_Action to store a time stamp

    This is working properly on the Add page but for the edit page could you please tell me what to change so that when a member goes to edit an item it will remove the previous date & time and replace it with the current data & time.
    I am assuming that i would just adjust the edit.asp page to not call for the data to autopopulate this field and use a defvalue Now() but I am uncertain exactly what to remove.
    Any help here is appreciated.
  2. is their any way to display a timestamp in long format eg) Sunday 4th March 2006, 11:00:00 pm

    That exact format is not required. Just how you would normally have a long date plus the time following.
    Thanks

    Michael

C
clig 3/3/2007

Hi,


  1. I have used the Now() function in a field called Last_Action to store a time stamp

    This is working properly on the Add page but for the edit page could you please tell me what to change so that when a member goes to edit an item it will remove the previous date & time and replace it with the current data & time.
    I am assuming that i would just adjust the edit.asp page to not call for the data to autopopulate this field and use a defvalue Now() but I am uncertain exactly what to remove.
    Any help here is appreciated.
  2. is their any way to display a timestamp in long format eg) Sunday 4th March 2006, 11:00:00 pm

    That exact format is not required. Just how you would normally have a long date plus the time following.
    Thanks

    Michael


In before edit add function
Function BeforeEdit(dict, where)
' Parameters:

' dict - Scripting.Dictionary object.

' Each field on the Edit form represented as 'Field name'-'Field value' pair

' where - string with WHERE clause pointing to record to be edited
'** Custom code ****

dict("Modified") = Now()
BeforeEdit = True
' set BeforeEdit to True if you like to proceed with editing this record

' set it to False in other case
End Function

J
Jane 3/5/2007

Michael,
to display datetime field in the long format with time select datetime on the "View as" settings dialog on the Visual Editor tab, build your project, then open generated include/locale.asp file, find following line:

format_datetime = format_datetime_custom(ttime,locale_info("LOCALE_SSHORTDATE") & " " & locale_info("LOCALE_STIMEFORMAT"))

and replace it with tis one:

format_datetime = format_datetime_custom(ttime,locale_info("LOCALE_SLONGDATE") & " " & locale_info("LOCALE_STIMEFORMAT"))