I want to get the time of my application runs in NetBeans, but it appears as a sequence of question marks. Does anyone know how to solve this?
Asked
Active
Viewed 70 times
2
-
2That's your build time from maven, not the time to run your code. You'll want System#currentTimeMillis and a lot of runs for that – Rogue Dec 25 '22 at 13:20
-
Generally, your NetBeans console is not displaying multibyte (non-ASCII) Unicode characters correctly. In the bottom right hand corner of your screenshot, we can see that the date and time values are using non-ASCII characters (not 0-9) - based on your system default settings. – andrewJames Dec 25 '22 at 20:50
-
Does this answer your question? [UTF-8 does not print characters to the console](https://stackoverflow.com/questions/63712074/utf-8-does-not-print-characters-to-the-console) – andrewJames Dec 25 '22 at 20:50
-
@skomisa - I take all your points, as always. I have withdrawn the dupe vote. In case it helps: When I print a date time as follows `DateTimeFormatter.ofPattern("d MMM, yyyy HH:mm Z", new Locale("ar")).withDecimalStyle(DecimalStyle.of(new Locale("ar")));`, then I get the following output in the NetBeans output window: `?? ??????, ???? ??:?? -0500`. The time zone portion displays as ASCII digits - interesting. However, I don't know (a) if this is in any way related to what the user is seeing; and (b) how this could be fixed for the build datetime generated by Maven (not by the user's code). – andrewJames Dec 27 '22 at 14:47
-
@andrewJames I think you have identified where the problem lies. Here's a somewhat similar issue with the Eclipse console: [date string is showing question marks](https://stackoverflow.com/q/36030836/2985643). Whether a fix for the OP's issue is possible is another matter, but it's an interesting problem. – skomisa Dec 27 '22 at 17:47
-
Please update your question to add the following: [1] Your Java version and Operating System version. You can get those from the **Help > About** window in NetBeans. [2] Your Maven version. You can get this from **Tools > Options > Java > Maven**, then select **Execution** from the _Categories_ list. Your Maven version will either be in the _Maven Home_ field, or displayed immediately beneath it. [3] Your default locale. You can get this from the _Administrative_ tab of your _Region_ window in Windows Control Panel. Those details help others when attempting to reproduce your problem. – skomisa Dec 27 '22 at 18:01