I am missing out seconds and this seems to be an inefficient way beacuse i do not need 'T' or offset in my output and i am getting rid of them. I am not sure if this question is already asked. Any help is appreciated.
I presume you are parsing the strings into date‑time objects correctly, but why not find out about reading times with format objects. That would obviate the long lines, for one thing.
Classes like LocalDateTime have lots of methods some of which can get the individual fields so you can use them with System.out.printf("...%d...",...); There are doubtless other ways to get a date formatted nicely: try the Java™ Tutorials.