Skip to main content
February 24, 2011
Question

DateTime Format problem

  • February 24, 2011
  • 1 reply
  • 461 views

I am using CreateODBCDateTime() function to create Simple date time format as
(mm/dd/yyyy- h:mm tt).  But, when I am dumping the file, format is changing to
{ts '2011-08-06 00:00:00'} . I want it to appear as formated. I have used DateFormat() along with CreateODBCDateTime().
In the real form the date and time are appering as formated.Please help. Thanks in advance.

Vijay.

    This topic has been closed for replies.

    1 reply

    Participant
    February 24, 2011

    Hi,

    CreateODBCDateTime() doesn't do any formatting for you, it creates an ODBCDateTime object. So when you output that object something like {ts '2011-08-06 00:00:00'} is what you get.

    If you want to format dates/times for display purposes you need to use the DateFormat() and TimeFormat() functions. So something like

    #DateFormat(yourDateTimeObject, "mm/dd/yyyy")# - #TimeFormat(yourDateTimeObject, "h:mm tt")#

    Will give you a formatted date and time.

    Hope this helps,

    Richard

    February 24, 2011

    Hi Richard,

    Thank you so much, it worked. I appreciate your help.

    Vijay.