Game Destiny
Game Destiny
JCHJava Community | Help. Code. Learn.
Created by Game Destiny on 12/13/2024 in #java-help
Looking for assistance getting a string to display on the frontend in an Angular project
Resolved it, doing a rewrite and changing the time zone to Denver helped. Thank you everyone!
22 replies
JCHJava Community | Help. Code. Learn.
Created by Game Destiny on 12/13/2024 in #java-help
Looking for assistance getting a string to display on the frontend in an Angular project
I may be doing these wrong but trying to find timezone examples is weird
22 replies
JCHJava Community | Help. Code. Learn.
Created by Game Destiny on 12/13/2024 in #java-help
Looking for assistance getting a string to display on the frontend in an Angular project
So I've done some investigating after reformatting some of my code to see if I could isolate the problem, and the issue doesn't seem to be that I'm trying to send a string to the front end, as I am able to do that with ease. Something is incorrect with my time conversion class. But I can't tell what. I've even tried rewriting them a few times to see if it wants specific terms.
public String timeConvert() {
String times;

DateTimeFormatter time_format = DateTimeFormatter.ofPattern("HH:mm");
ZonedDateTime ETZ = ZonedDateTime.now(ZoneId.of("America/New_York"));
ZonedDateTime UTCZ = ZonedDateTime.now(ZoneId.of("UTC"));
ZonedDateTime MTZ = ZonedDateTime.now(ZoneId.of("America/Mountain"));
String ET_time = ETZ.format(time_format);
String MT_time = MTZ.format(time_format);
String UTC_time = UTCZ.format(time_format);

times = "Eastern time: " + ET_time + "\nMountain time: "+ MT_time + "\nUTC time: " + UTC_time;
return times;
}
}
public String timeConvert() {
String times;

DateTimeFormatter time_format = DateTimeFormatter.ofPattern("HH:mm");
ZonedDateTime ETZ = ZonedDateTime.now(ZoneId.of("America/New_York"));
ZonedDateTime UTCZ = ZonedDateTime.now(ZoneId.of("UTC"));
ZonedDateTime MTZ = ZonedDateTime.now(ZoneId.of("America/Mountain"));
String ET_time = ETZ.format(time_format);
String MT_time = MTZ.format(time_format);
String UTC_time = UTCZ.format(time_format);

times = "Eastern time: " + ET_time + "\nMountain time: "+ MT_time + "\nUTC time: " + UTC_time;
return times;
}
}
22 replies
JCHJava Community | Help. Code. Learn.
Created by Game Destiny on 12/13/2024 in #java-help
Looking for assistance getting a string to display on the frontend in an Angular project
No description
22 replies