Hi all
In my java app i am reading date time from BBB with externally connected RTC using java library that provided for data/time, my issue is i am not able to read time as expected(hh:mm:ss), anybody faced similar issue?, is there any solution?
Hi all
In my java app i am reading date time from BBB with externally connected RTC using java library that provided for data/time, my issue is i am not able to read time as expected(hh:mm:ss), anybody faced similar issue?, is there any solution?
Speaking of time zone, you can retrieve it as a symbol or offset from UTC along with the local date and time by using Java 8 class ZonedDateTime. A simple example follows.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import java.time.format.DateTimeFormatter;
import java.time.ZonedDateTime;
public class dateeg {
public static void main( String [ ] args ) {
ZonedDateTime zdt = ZonedDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss VV");
System.out.println( "Now = " + zdt.format(formatter) );
}
}
Execution for me in Dallas Texas USA:
Now = 13:17:18 America/Chicago
Speaking of time zone, you can retrieve it as a symbol or offset from UTC along with the local date and time by using Java 8 class ZonedDateTime. A simple example follows.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import java.time.format.DateTimeFormatter;
import java.time.ZonedDateTime;
public class dateeg {
public static void main( String [ ] args ) {
ZonedDateTime zdt = ZonedDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss VV");
System.out.println( "Now = " + zdt.format(formatter) );
}
}
Execution for me in Dallas Texas USA:
Now = 13:17:18 America/Chicago