How to change the date format in Doors 9.5?
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
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"
Date format in 9.x is determined by the client system locale, so it is not necessarily common or global.
Comments
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?
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