Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

How to use the currentTimeMillis() method in java

  • 17-12-2004 03:45PM
    #1
    Moderators, Society & Culture Moderators, Sports Moderators, Paid Member Posts: 12,403 Mod ✭✭✭✭


    could someone post up a bit of code illustrating how exactly to use this method or alternatively if there is a mthod in java that just returnd the time in hours and minutes could you post that up instead. Thanking you

    Patrick


Comments

  • Registered Users, Registered Users 2 Posts: 584 ✭✭✭bambam


    Date today;
    String dateOut;
    DateFormat dateFormatter;
    dateFormatter = DateFormat.getDateInstance(DateFormat.DEFAULT);
    today = new Date();
    dateOut = dateFormatter.format(today);
    System.out.println("Date : " + dateOut + " " );


    // calling new Date() gives you a date as of 'now'.


  • Moderators, Society & Culture Moderators, Sports Moderators, Paid Member Posts: 12,403 Mod ✭✭✭✭Kingp35


    nice one worked perfectly


Advertisement