It's all about the answers!

Ask a question

How to change the date format in Doors 9.5?


Dinyo Dinev (311134) | asked Nov 23 '15, 6:11 a.m.
Hi, when I have to query by date I have to pass the date in specific format:
yyyy-MM-dd'T'HH:mm:ss
But the date come from another system which is with different one, and I have to make pre-formatting of the date all the time, so I am wondering if there is a way to change the date format while quering to specific one for example:
yyyyMMddHHmmss


Thanks in advanced.

2 answers



permanent link
stuart green (661) | answered Nov 23 '15, 10:38 a.m.

You get quite good control over the format of dates using the stringOf perm, defined as:

"string stringOf(Date d[, Locale l][, string s] )"

That doesn't quite allow for the required format, so, how about something like this:

"Date d = dateAndTime today
string s = stringOf(d, "yyyy-MM-dd")
string ss = replaceRichText (s, 10, 1, "'T'")
print ss"


Comments
Dinyo Dinev commented Nov 23 '15, 11:42 a.m.

I do not understand what is that is a kind of DXL? Where to put it ? I can change the format from the java but I need a decision to make it globally? Is there a way to do that from the UI admin interface in 9.5 or fat client in 9.3?


permanent link
stuart green (661) | answered Nov 23 '15, 1:33 p.m.
I was assuming you were running the query/compare inside DXL, in which case the conversion could be done in the same context: either a fat client, or via OSLC DXL services.

Date format in 9.x is determined by the client system locale, so it is not necessarily common or global.

Comments
Dinyo Dinev commented Nov 24 '15, 2:56 a.m.

So, I have to change the locale of the server? But the language is dependent on this. And if another server in different zone is put then the logic behind will not work.  So @stuart green, you say that there is no way to make global date format change, except change of the locale of the machine? Is that right?


stuart green commented Nov 24 '15, 6:00 a.m.

Date format in 9.x is determined by the client system locale.

I'm not aware of a global option.

http://www-01.ibm.com/support/knowledgecenter/SSYQBZ_9.6.0/com.ibm.doors.administering.doc/topics/c_useroptionsforlocales.html

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.