![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Formatting Dates after Date Calculations Topic Summary: Created On: 29-May-2003 21:52 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Hi, Thanks for your answers. I figured it out: Using the sample code from Mike above, if you print o."Req Freeze", it'll still print in "mm/dd/yy hh:mm:ss" format. I wanted to either get it in the Default DOORS Long form, or put it in mm/dd/yy (within a Date field). So I added a few other statements to convert a date to Default DOORS Long form: Date Target_Date = today Date newDate int Target_Date_int = intOf( Target_Date ) int secs_per_week = 60 * 60 * 24 * 7 int leadweeks = 5 int i = Target_Date_int - secs_per_week * leadweeks string s = dateOf i "" <--- need this for casting newDate = s[0:8] This puts the date in the "dd Month yyyy" format, for example "02 June 2003". | |
![]() |
|
Hi,
Has anyone done date calculations, such as T-5 weeks to come up with a new date? The result is that the new date has a format of "mm/dd/yy hh:mm:ss", such as "05/04/03 00:00:00". The question I have is how do you get the format to be consistent with the rest of the default DOORS dates: "dd Month yyyy". I believe the default format is called long format. The format that's coming out seems to be short format with time added. My code does the following: if (Tier == "1") { o."Req Freeze" = dateOf(intOf(Target_Date) - secs_per_week * leadweeks) } o.Req Freeze then has the format of "05/04/03 00:00:00". I'm trying to accomplish just getting the short date WITHOUT the time, or get the default DOORS format of "dd Month yyyy". An alternate question would be, is there any other way to subtract 5 weeks from a date to come up with a new date, and have that date be formatted short form without the time, or the default long form? THANK YOU FOR ANY CLUES! |
|
![]() |
|
![]() |
|
Debbie,
Try it as coded below. The "intOf()" function does not seem to work when applied directly to a Date string or Date function return value or Date Attribute return value. It does work on the contents of a Date variable. This is likely a typecasting issue. Make sure the Date of interest is put in a Date variable before being passed to the intOf() function. Also, you will want to use the dateOf() function only after all of your integer based calculations are completed. ------------------------- Michael Sutherland michael@galactic-solutions.com http://galactic-solutions.com |
|
![]() |
|
![]() |
|
Hi,
Thanks for your answers. I figured it out: Using the sample code from Mike above, if you print o."Req Freeze", it'll still print in "mm/dd/yy hh:mm:ss" format. I wanted to either get it in the Default DOORS Long form, or put it in mm/dd/yy (within a Date field). So I added a few other statements to convert a date to Default DOORS Long form: Date Target_Date = today Date newDate int Target_Date_int = intOf( Target_Date ) int secs_per_week = 60 * 60 * 24 * 7 int leadweeks = 5 int i = Target_Date_int - secs_per_week * leadweeks string s = dateOf i "" <--- need this for casting newDate = s[0:8] This puts the date in the "dd Month yyyy" format, for example "02 June 2003". Edited: 3-Jun-2003 at 19:26 by Debbie Shao |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Formatting Dates after Date Calculations
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.