Date and Time

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob

    Date and Time

    I'm probably not understanding this correctly but I can't seem to get the
    system date and time using the calendar class.

    I'm trying this:

    rightNow = Calendar.getIns tance();

    where rightNow is an int. Not working at all. Newbie question I'm sure but I
    obviously cant follow the documentation.

    Thanks


  • Ryan Stewart

    #2
    Re: Date and Time

    "Rob" <talon2lm@yahoo .com> wrote in message
    news:CIadnQg4wP [email protected]. ..[color=blue]
    > I'm probably not understanding this correctly but I can't seem to get the
    > system date and time using the calendar class.
    >
    > I'm trying this:
    >
    > rightNow = Calendar.getIns tance();
    >
    > where rightNow is an int. Not working at all. Newbie question I'm sure but[/color]
    I[color=blue]
    > obviously cant follow the documentation.
    >
    > Thanks[/color]

    Part of you problem may be that Calendar.getIns tance() returns an instance
    of Calendar. Not an int.

    Calendar rightNow = Calendar.getIns tance();


    Comment

    • JavaJunkie

      #3
      Re: Date and Time



      You should consult the javadocs.




      "Rob" <talon2lm@yahoo .com> wrote in message
      news:CIadnQg4wP [email protected]. ..[color=blue]
      > I'm probably not understanding this correctly but I can't seem to get the
      > system date and time using the calendar class.
      >
      > I'm trying this:
      >
      > rightNow = Calendar.getIns tance();
      >
      > where rightNow is an int. Not working at all. Newbie question I'm sure but[/color]
      I[color=blue]
      > obviously cant follow the documentation.
      >
      > Thanks
      >
      >
      >[/color]


      Comment

      Working...