Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
ZonedDateTime testing
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; import java.time.*; class Rextester { public static void main(String args[]) { ZonedDateTime t = ZonedDateTime.now(); int year = t.getYear(); int month = t.getMonthValue(); int day = t.getDayOfMonth(); int testDay = 6; ZoneId timezone = ZoneId.of("America/New_York"); long d = ZonedDateTime.of(year, month, testDay, 0, 0, 0, 0, timezone).toEpochSecond(); ArrayList<Long> list = new ArrayList<Long>(); for (int i = 0; i < 7; i++){ d -= 86400L; list.add(d); } for (int i = 0; i < list.size(); i++){ System.out.println(new Date(list.get(i)*1000)); System.out.println(list.get(i)); } } }
run
|
edit
|
history
|
help
0
Coloring map
1a
Coding Challenge - 02 (Odd numbers)
2
output2
piglatin
output1
S
Problem: rstring
Display Page