OffsetTime withSecond(int second) example
Description
OffsetTime withSecond(int second)
returns a copy of this OffsetTime with the second-of-minute value altered.
Syntax
withSecond
has the following syntax.
public OffsetTime withSecond(int second)
Example
The following example shows how to use withSecond
.
import java.time.OffsetTime;
/* ww w .ja v a 2s.c o m*/
public class Main {
public static void main(String[] args) {
OffsetTime m = OffsetTime.now();
OffsetTime n = m.withSecond(34);
System.out.println(n);
}
}
The code above generates the following result.