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: dateOf format
Topic Summary: how can I specify the format of the result of dateOf MyDate?
Created On: 11-May-2006 16:26
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.
 11-May-2006 16:26
User is offline View Users Profile Print this message


paul siemons

Posts: 1
Joined: 11-May-2006

the program fragment below gives the date in an unwanted format. How can this be manipulated into the desired format yyyy-mm-dd?

Date MyDate = "29 Dec 2002"
int MyTemp = intOf MyDate
print dateOf MyDate "\n"
=> 12/29/2002 02:00:00

Paul

Report this to a Moderator Report this to a Moderator
 11-May-2006 16:44
User is offline View Users Profile Print this message


Iftakher Uddin

Posts: 56
Joined: 16-Sep-2004

Hi,

Are you sure that the given program returns the same output you mentioned? For me, I got some dxl error :-p

Anyway, you can get the mentioned date format if you do some string manipulation. Try the following code:


string sYYYYMMDD = ""
string sTmp = ""
Date MyDate = "29 Dec 2002"
int MyTemp = intOf MyDate
sTmp = MyDate ""

//for Year
sYYYYMMDD = sTmp[length(sTmp)-4:length(sTmp)]
//for Month
sTmp = (dateOf MyTemp) ""
sYYYYMMDD = sYYYYMMDD "-" sTmp[0:1]
//for Day
sYYYYMMDD = sYYYYMMDD "-" sTmp[3:4]
print sYYYYMMDD "\n"


//it will print 2002-12-29

Greetings,

Rony

=================
Iftakher Uddin (Rony)
HOOD Group
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.