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

Creating a ZonedDateTime from an Instant gives an error in both Netbeans and Eclipse

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Suse Tumbleweed latest with JDK 23

      A DESCRIPTION OF THE PROBLEM :
      Creating a ZonedDateTime from an Instant gives an error in both Netbeans and Eclipse.

      API doc: static ZonedDateTime.ofInstant(Instant instant, ZoneId zone)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Instant inst = Instant.now();
      ZonedDateTime dt = ZonedDateTime.of(inst, ZoneId.systemDefault());

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      From API doc I expected a ZonedDateTime object
      ACTUAL -
      Both IDE's indicate an error

            tongwan Andrew Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: