Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Formatting the Attribute type "Date"
Topic Summary: Different format for Attribute
Created On: 8-Mar-2005 15:25
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 8-Mar-2005 15:25
User is offline View Users Profile Print this message


Donna Decker

Posts: 20
Joined: 6-Jul-2004

Hello,

Does anyone know if there is a way to change the date format from "08 March 2005" to another format (e.g. MM/DD/YYYY)

Thanks,
Donna
Report this to a Moderator Report this to a Moderator
 8-Mar-2005 20:49
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

///The following dxl will print out today as  mm/dd/yy
/*Demo*/

int i = intOf( today )

string s= dateOf ( i) ""

s= s[0:8]

print s

Report this to a Moderator Report this to a Moderator
 8-Mar-2005 21:23
User is offline View Users Profile Print this message


Donna Decker

Posts: 20
Joined: 6-Jul-2004

Thanks.

Will this also display in this format as well? or just Print?
Report this to a Moderator Report this to a Moderator
 8-Mar-2005 23:49
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

 ///The following dxl will display today  as mm/dd/yy

/*Demo*/

int i = intOf( today )

string s= dateOf ( i) ""

s= s[0:8]

display s

Report this to a Moderator Report this to a Moderator
 16-Nov-2005 14:31
User is offline View Users Profile Print this message


Donna Decker

Posts: 20
Joined: 6-Jul-2004

I've taken your script, went to TOOLS -> Edit DXL and ran it. There were no errors, but my date formats (for the attributes with "Date" type) hasn't changed.

Am I doing something wrong?
Report this to a Moderator Report this to a Moderator
 16-Nov-2005 16:49
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Ron's script displays the date today in that format.

If you want to display the value of a Date attribute in that format then you need to use a layout DXL column rather than a plain attribute column. Try the following code, substituting the name of your attribute:

Date d = obj."My date Atrr"

int i = intOf(d)

string s= dateOf ( i) ""

s= s[0:8]

display s


An alternative is to create a DXL attribute and display this in a column.
To do this, create a new attribute of type string, check the DXL attribute checkbox and enter the following code, substituting the name of your attribute:

Date d = obj."My date Atrr"

int i = intOf(d)

string s= dateOf ( i) ""

obj.attrDXLName = s[0:8]

Then you can use this attribute instead of the original. Beware that this is only of use for display and printing. Don't try to use the string representation o the date for comparisons etc.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.