Java Date Time - LocalDate atTime(int hour, int minute) example








LocalDate atTime(int hour, int minute) combines this date with a time to create a LocalDateTime.

Syntax

atTime has the following syntax.

public LocalDateTime atTime(int hour,   int minute)

Example

The following example shows how to use atTime.

import java.time.LocalDate;
import java.time.LocalDateTime;
/*from  w  w  w  . j  a  v  a 2s. co  m*/
public class Main {
  public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);

    LocalDateTime l = a.atTime(2,3);    
    System.out.println(l); 
  }
}

The code above generates the following result.