I am getting confused now... Apparently I did something wrong yesterday, and I am now unable to repeat all of what I stated earlier...
I am now able to get two formats to work on my sv_SE locale: mm/dd/yyyy H:MM:SS AM/PM yyyy-mm-dd HH.MM.SS I also tried, as per Jarl Grönengs suggestion, to add -Duser.language=en/sv -Duser.country=US/EN, but without any change to the result. So the question is if these are fixed formats in the Java API or if it can be controlled from outside the Java program. Best Regards - Misi, RRR AB, http://www.rrr.se (http://www.rrr.se) (ARSList MVP 2011) Ask the Remedy Licensing Experts (Best R.O.I. Award at WWRUG10/11/12/13) * RRR|License - Not enough Remedy licenses? Save money by optimizing. * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs Find these products, and many free tools and utilities, at http://rrr.se (http://rrr.se) December 14, 2017 9:53 AM, "Misi Mladoniczky" wrote: Hi, I was not over informative of what programs I used, because I was hoping to find a general way to do this as in the Remedy C-API using env variable ARDATE. Maybe by changing the locale settings. But I am using the artools/arexport.{sh,bat} included with the server. In this case version 9.1, with the -q qualifier option set. My investigation tells me that the format is kind of flexible, but can not be controlled. The date portion is parsed as one of three depending on these delimiters, and possibly others: yyyy-mm-dd yyyy.mm.dd mm/dd/yyyy The time portion on these delimiters: HH.MM.SS (24-hour time) H:MM:SS AM/PM (12-hour am/pm time) And this is for the parseQualification helper method and nothing else. Best Regards - Misi, RRR AB, http://www.rrr.se (http://www.rrr.se) (ARSList MVP 2011) Ask the Remedy Licensing Experts (Best R.O.I. Award at WWRUG10/11/12/13) * RRR|License - Not enough Remedy licenses? Save money by optimizing. * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs Find these products, and many free tools and utilities, at http://rrr.se (http://rrr.se) December 14, 2017 12:03 AM, "Carl Wilson" wrote: Then the date format is taken from the AR Server format. ---------------------------------------------- Kind Regards, Carl Wilson From: ARSList [mailto:[email protected] (mailto:mailto:[email protected])] On Behalf Of LJ LongWing Sent: 13 December 2017 22:51 To: ARSList Subject: Re: Date format in Java API search criteria The problem here is that he's not writing a java application, he's using an existing BMC provided tool, he just wants to be able to specify the date format for his queries.... On Wed, Dec 13, 2017 at 3:46 PM, Carl Wilson wrote: Hi Misi, When using dates in Java, I predefine the date format to use with the following: Declarations static DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); Then when invoking, use the following to convert the date(s) correctly: Date dateLicenseDate = dateFormat.parse(strLicenseDate); Other examples: Date date = new Date(); String strDateNow = dateFormat.format(date); Date dateNow = dateFormat.parse(strDateNow); ---------------------------------------------- Kind Regards, Carl Wilson From: ARSList [mailto:[email protected] (mailto:[email protected])] On Behalf Of Misi Mladoniczky Sent: 13 December 2017 18:10 To: ARSList Subject: Re: Date format in Java API search criteria Hi, Some further testing seems to indicate that the following different formats always works in any combination: Date portion: "2017-01-31", "2017.01.31" or "01/31/2017" Time portion: "23.59.59" or "11:59:59 PM" There might be more that works, but the question about controlling the format still remains... Best Regards - Misi, RRR AB, http://www.rrr.se (http://www.rrr.se) (ARSList MVP 2011) Ask the Remedy Licensing Experts (Best R.O.I. Award at WWRUG10/11/12/13) * RRR|License - Not enough Remedy licenses? Save money by optimizing. * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs Find these products, and many free tools and utilities, at http://rrr.se (http://rrr.se) December 13, 2017 6:01 PM, "Grooms, Frederick W" wrote: What if you do set ARDATE? From: ARSList [mailto:[email protected] (mailto:mailto:[email protected])] On Behalf Of Misi Mladoniczky Sent: Wednesday, December 13, 2017 10:46 AM To: ARSList Subject: Re: Date format in Java API search criteria Hi, Well, on my Ubuntu-machine it apparently defaults to the Swedish format "YYYY-MM-DD HH:mm:ss". One of my clients using that same program are successfully using the format "M/D/YYYY h:mm:ss a"... I tried changing my LANG environment variable without success. It seems to pick up some other system setting. My standard setting: locale LANG=sv_SE.UTF-8 LANGUAGE=sv LC_CTYPE="sv_SE.UTF-8" LC_NUMERIC=sv_SE.UTF-8 LC_TIME=sv_SE.UTF-8 LC_COLLATE="sv_SE.UTF-8" LC_MONETARY=sv_SE.UTF-8 LC_MESSAGES="sv_SE.UTF-8" LC_PAPER=sv_SE.UTF-8 LC_NAME=sv_SE.UTF-8 LC_ADDRESS=sv_SE.UTF-8 LC_TELEPHONE=sv_SE.UTF-8 LC_MEASUREMENT=sv_SE.UTF-8 LC_IDENTIFICATION=sv_SE.UTF-8 LC_ALL= I reset LC_ALL and get this, but the parseQualification still uses the same YYYY-MM-DD format: locale LANG=en_US.UTF-8 LANGUAGE=sv LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=en_US.UTF-8 Best Regards - Misi, RRR AB, http://www.rrr.se (http://www.rrr.se) (ARSList MVP 2011) Ask the Remedy Licensing Experts (Best R.O.I. Award at WWRUG10/11/12/13) * RRR|License - Not enough Remedy licenses? Save money by optimizing. * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs Find these products, and many free tools and utilities, at http://rrr.se (http://rrr.se) December 13, 2017 5:29 PM, "LJ LongWing" wrote: ok....that's a very good question that I've never had to explore.....the API defaults to MM-DD-YYYY HH:MM:SS type of format....which is standard in America (and just about nowhere else)....I've never had to deal with date/time formatting in the Java API....so sorry, I don't have a ready answer for you :| On Wed, Dec 13, 2017 at 9:15 AM, Misi Mladoniczky wrote: Hi, You sort of understood. It concerns controlling the date+time format when the Java-API program is calling the parseQualification method. In a C-API program, you just set the environment variable ARDATE before running it, and it will use the specified format. So how can you control this before running a Java-API program? Best Regards - Misi, RRR AB, http://www.rrr.se (http://www.rrr.se) (ARSList MVP 2011) Ask the Remedy Licensing Experts (Best R.O.I. Award at WWRUG10/11/12/13) * RRR|License - Not enough Remedy licenses? Save money by optimizing. * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs Find these products, and many free tools and utilities, at http://rrr.se (http://rrr.se) December 13, 2017 5:11 PM, "LJ LongWing" wrote: I'm sorry Misi, I'm not sure I understand your inquiry...are you asking how do you tell the Java api that when using the parseQualification method what format a date, included in that string is? On Wed, Dec 13, 2017 at 9:04 AM, Misi Mladoniczky wrote: Hi, How do you control which date format is used by a client Java ARAPI program when parsing the qualifier string before q query? In the C-API you would set environment ARDATE="%Y-%m-%d %H:%M:%S" or similar. Best Regards - Misi, RRR AB, http://www.rrr.se (http://www.rrr.se) (ARSList MVP 2011) Ask the Remedy Licensing Experts (Best R.O.I. Award at WWRUG10/11/12/13) * RRR|License - Not enough Remedy licenses? Save money by optimizing. * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs Find these products, and many free tools and utilities, at http://rrr.se (http://rrr.se) -- ARSList mailing list [email protected] (mailto:[email protected]) https://mailman.rrr.se/cgi/listinfo/arslist (https://mailman.rrr.se/cgi/listinfo/arslist) -- ARSList mailing list [email protected] (mailto:[email protected]) https://mailman.rrr.se/cgi/listinfo/arslist (https://mailman.rrr.se/cgi/listinfo/arslist) (https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient) Virus-free. www.avast.com (https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient) -- ARSList mailing list [email protected] (mailto:[email protected]) https://mailman.rrr.se/cgi/listinfo/arslist (https://mailman.rrr.se/cgi/listinfo/arslist)
-- ARSList mailing list [email protected] https://mailman.rrr.se/cgi/listinfo/arslist

