On Oct 4, 7:41 pm, Nguyễn Đình Đoàn <[email protected]> wrote: > Hi friends, > > When I run command: System.out.println(new Date()); > It printed out: *Tue Oct 05 00:32:53 ICT 2010* > So, If I have a String as "*Tue Oct 05 00:32:53 ICT 2010"* > *How to convert it to Date (java.util.Date)* > * > * > I tried running: > > * > DateFormat f = new SimpleDateFormat("EEE MMM dd hh:mm:ss z yyyy"); SimpleDateFormat f = ... but the problem is that it replies in my locale (by me in France): Mon Oct 04 19:32:53 CEST 2010
and I don't have an equivalent locale in Java for ICT (GMT+7 I guess) if you have this locale, you could add: Locale.whatever as a parameter to SimpleDateFormat Apart from that I don't know. Michèle Garoche -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en
