Skip to content
Advertisement

Tag: simpledateformat

Android Format date with time zone

I need to format the date into a specific string. I used SimpleDateFormat class to format the date using the pattern “yyyy-MM-dd’T’HH:mm:ssZ” it returns current date as “2013-01-04T15:51:45+0530” but I need as “2013-01-04T15:51:45+05:30”. Below is the coding used, Output: formatted string: 2013-01-04T15:51:45+0530 I need the format as 2013-01-04T15:51:45+05:30 just adding the colon in between gmt time. Because I’m working on

Date formatting according to country habbits

We create J2SE application that has to format the date and time according to custom the country from which users come from. I want to ask how to solve this thing in Java? Probably I’ll use SimpleDateFormat, but I wonder if it is possible to get format string in somehow simpler way than to have all format strings for each

Advertisement