Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8039167

SimpleDateFormat should support 'Q' as milliseconds from epoch.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 7u51
    • core-libs
    • x86_64
    • windows_7

      A DESCRIPTION OF THE REQUEST :
      Unlike the java.util.Formatter the java.text.MessageFormat doesn't support formatting the built in date types as milliseconds from epoch. The java.util.Formatter uses 'Q' to represent this transformation which is currently not used and not supported in the java.text.MessageFormat and java.text.SimpleDateFormat which is used by the MessageFormat.

      JUSTIFICATION :
      Under the hood the logging API (java.util.logging.Formatter) uses the MessageFormatter to transform LogRecord parameters from localized key from a ResourceBundle or a raw pattern. Having the option for parameter that is of type java.util.Date to be converted into milliseconds from epoch would be helpful for troubleshooting.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The 'Q' pattern would return java.util.Date.getTime().
      ACTUAL -
      Not supported.

            naoto Naoto Sato
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: