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: Getting the time out of today()
Topic Summary: ...there must be an easier way...
Created On: 10-Oct-2006 10:08
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.
 10-Oct-2006 10:08
User is offline View Users Profile Print this message


Martin Erdelen

Posts: 15
Joined: 14-Aug-2006

Hello,

wishing to extract the time from today(),

// DXL start
loc = userLocale
Date d,d2

d = today()
print includesTime(d)"\n"                            // prints: false
print stringOf(d,loc,"d MMMM yyyy")"\n\n"  // prints: 10 October 2006

d2 = dateOf(intOf(today()))              
print includesTime(d2)"\n"                          // prints: true  (_should_ print: suddenly true :-)
print stringOf(d2,loc,"d MMMM yyyy")         // prints: 10 October 2006 11:45:09
//DXL end

Why the detour?

Cheers,
Martin

Report this to a Moderator Report this to a Moderator
 10-Oct-2006 12:22
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Try:

Date d2 = dateOf(intOf(today()))
string sTime = d2 ""
sTime=sTime[9:]
print sTime
Report this to a Moderator Report this to a Moderator
 10-Oct-2006 13:36
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

The utility function described here could be easily modified to do what you want.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 10-Oct-2006 16:38
User is offline View Users Profile Print this message


Nils Palsson

Posts: 1
Joined: 19-Jul-2005

If you are using DOORS 8.1 try print dateAndTime(today)
Report this to a Moderator Report this to a Moderator
 16-Oct-2006 10:39
User is offline View Users Profile Print this message


Martin Erdelen

Posts: 15
Joined: 14-Aug-2006

Hello,

and thanks for the comments!

It was not a practical problem so much as a "philosophical" (moral?? ) one:

A function result (from today() ) of type Date which clearly does contain time info (viz., seconds since 1.1.1970 00:00h) first lies to me about it (includesTime()==false), and only confesses after I have turned it into an int value, and that int value then back into a Date. (DXL equivalent of the medieval torture rack??)

dateAndTime() is nice, thanks for the pointer (we have only just moved to 8.1).
If only it wouldn't (in its pure form) use the US format (MM/dd/yyyy) which is always awkward for us poor Europeans -- we can handle 12/24/2006, but 07/04/2006 always stops us dead in our tracks (esp. as some people(s) seem to use also dd/MM/yyyy ...)

However, the testDate() example in the Help for dateAndTime() includes all I'll ever need.

Thanks again for the support.

Cheers,
Martin
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.