![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
Try:
Date d2 = dateOf(intOf(today())) string sTime = d2 "" sTime=sTime[9:] print sTime |
|
![]() |
|
![]() |
|
The utility function described here could be easily modified to do what you want.
------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
|
![]() |
|
If you are using DOORS 8.1 try
print dateAndTime(today)
|
|
![]() |
|
![]() |
|
Hello,
and thanks for the comments! It was not a practical problem so much as a "philosophical" (moral?? ![]() 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 ![]() However, the testDate() example in the Help for dateAndTime() includes all I'll ever need. Thanks again for the support. Cheers, Martin |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Getting the time out of today()
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.