Print Page | Close Window

Report Control - Formatting a date

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1038
Printed Date: 10 May 2025 at 12:12am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Report Control - Formatting a date
Posted By: Maui
Subject: Report Control - Formatting a date
Date Posted: 09 August 2004 at 5:00am

Hi,

I was wondering if someone could advise me on the best way to format a date in the report control.

Assume I have entered Record.AddItem "09/08/2004 10:56:20"
But I want it displayed "9th August 2004"

Is this something I could use .format to do? If so could you please provide example showing how?

or would it be best to do it in the _BeforeDrawRow event?

or should I format it before I enter it into the report control?

Thanks




Replies:
Posted By: SuperMario
Date Posted: 09 August 2004 at 6:22am
Format the date before you add it.  The "Format" property currently does not support this type of formatting. 


Posted By: SuperMario
Date Posted: 22 February 2005 at 11:34am
The Format property can now be used to set the date format.

    '%a Abbreviated weekday name
    '%A Full weekday name
    '%b Abbreviated month name
    '%B Full month name
    '%c Date and time representation appropriate for locale
    '%d Day of month as decimal number (01 – 31)
    '%H Hour in 24-hour format (00 – 23)
    '%I Hour in 12-hour format (01 – 12)
    '%j Day of year as decimal number (001 – 366)
    '%m Month as decimal number (01 – 12)
    '%M Minute as decimal number (00 – 59)
    '%p Current locale’s A.M./P.M. indicator for 12-hour clock
    '%S Second as decimal number (00 – 59)
    '%U Week of year as decimal number, with Sunday as first day of week (00 – 53)
    '%w Weekday as decimal number (0 – 6; Sunday is 0)
    '%W Week of year as decimal number, with Monday as first day of week (00 – 53)
    '%x Date representation for current locale
    '%X Time representation for current locale
    '%y Year without century, as decimal number (00 – 99)
    '%Y Year with century, as decimal number
    '%z, %Z Time-zone name or abbreviation; no characters if time zone is unknown
    '%% Percent sign
    '%#c Long date and time representation, appropriate for current locale. For example: “Tuesday, March 14, 1995, 12:41:29”.
    '%#x Long date representation, appropriate to current locale. For example: “Tuesday, March 14, 1995”.
    '%#d, %#H, %#I, %#j, %#m, %#M, %#S, %#U, %#w, %#W, %#y, %#Y Remove leading zeros (if any).


    Item.Format = "%a %m/%d/%Y %I:%M %p"



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net