This topic is locked

Time Field showing Date in List Page

4/22/2008 4:09:29 PM
ASPRunnerPro General questions
S
seaninsjca author

I am running an evaluation version of ASPRunnerPro 5.2 with IIS6 and MySQL.
I have a Table which has a Time field named "Time" and Type is set to Time.
I also have a Date field named "Date" and Type is set to Date.
When running the output files on the Add Page, the date (short date) and time fields show correctly and are auto-populated using the Date() and the Time() VBScript and the fields are set to Read Only.
The Edit Page (Successful Add) also shows the time and date correctly( m/dd/yyyy, and h:mm:ss tt).
The List Page shows the date field as m/dd/yyyy and the time as m:dd:yyyy tt
For some reason, on the final output, the date is getting populated into the time field.
The data is populated correctly into the MySQL database.
Where should I look to try to correct this issue?
Thank You!

J
Jane 4/23/2008

Hi,
please make sure you've selected correct formats for these fields on the "View as" settings dialog on the Visual Editor tab.

S
seaninsjca author 4/23/2008

If I set the field to View as "Time" I get 4:23:2008 AM (the date is 4/23/2008)
If I set the field to View as "Custom" and do not enter any code I get "4/23/2008 11:34:41 AM" which is correct for time and date, but I just want the time to be shown here.

Hi,

please make sure you've selected correct formats for these fields on the "View as" settings dialog on the Visual Editor tab.

Sergey Kornilov admin 4/23/2008

Try "View as" type Custom and the following code:
strValue = FormatDateTime(CDate(strValue),3)
More info: http://www.w3schools.com/VBscript/func_formatdatetime.asp

S
seaninsjca author 4/23/2008

You are completely AWESOME!!! Thanks... I should have posted this 3 days ago and I'd still have hair left.
Sean

Try "View as" type Custom and the following code:

strValue = FormatDateTime(CDate(strValue),3)
More info: http://www.w3schools.com/VBscript/func_formatdatetime.asp