This topic is locked

Format of date and time fields in an email

7/28/2009 5:09:00 PM
ASPRunnerPro General questions
G
goffj1 author

Asp Runner 6.1 - I have a "after add" event that send an email and contains a date field, start time and end time fields. Field names are PDate, PStart and PEnd.
The form has these fields defined as a DATE with MM/YY/YYYY and the two time fields are defined as TIME. When the form adds the data to the database all is formatted as desired in the database. I should add that the backend database (Access2007) has the fields formats defined in Access as well so this may be why they show up as SHORT DATE and MEDIUM TIME in Access.
When the form shows the PDate as "7/28/2009" the email created shows "2009-7-28 0:0:0"

When the form shows the PSTART as "14:00" the email created shows "2000-01-01 14:0:0"

Similar for PEnd
I have tried, in the body of the email - Format(Dict("PDate"),"mm/dd/yy") - but this doesn't work.
Can someone point me in the right direction?

J
Jane 7/29/2009

Hi,
here is a sample code:

format_shortdate(db2time(dict("PDate")))

str_format_time(db2time(dict("PSTART")))

G
goffj1 author 7/29/2009

Hi,

here is a sample code:


Works great - thanks so much.

B
brett 9/29/2009

where do you put this?



Hi,
here is a sample code:

J
Jane 9/30/2009

Hi,
you can use this code in the After record added/updated events on the Eventstab.