September 04, 2010, 03:37:20 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  Home Help Media Affiliates Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Problem with converting time  (Read 1316 times)
0 Members and 1 Guest are viewing this topic.
jurka
Staff
Member
*
*

Reputation: 5
Offline Offline
Posts: 188
Referrals: 0

Awards
« on: August 19, 2009, 07:08:48 AM »

Oh the java's time makes my head  stupid. Problem is that i got strin UTC time example it's string 20090818075800 +0300. How to convert this human readable format dd / mm / yyyy Minutes : Hours
Logged
Javaforums.net :: a community about Java software development.
« on: August 19, 2009, 07:08:48 AM »

Your Ad Here
 Logged
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2620
Referrals: 13

WWW Awards
« Reply #1 on: August 19, 2009, 07:35:42 AM »

Oh the java's time makes my head  stupid. Problem is that i got strin UTC time example it's string 20090818075800 +0300. How to convert this human readable format dd / mm / yyyy Minutes : Hours

Can't you split the string into an array and create a date object with the values in the string array? Use the simpledateformat class to format the date and use the timezone class getOffset method to get the offset timezone in UTC.



formating a date object:
http://www.javaforums.net...javautildate-t3318.0.html
http://www.javaforums.net...play_the_time-t105.0.html
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
trey
Member
*

Reputation: 0
Offline Offline
Posts: 16
Referrals: 0

Awards
« Reply #2 on: December 07, 2009, 08:45:08 PM »

May save you a lot of division:

http://java.sun.com/j2se/...il/GregorianCalendar.html
« Last Edit: December 07, 2009, 08:58:30 PM by trey » Logged
Javaforums.net :: a community about Java software development.
   

 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here
Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.245 seconds with 36 queries.

Google visited last this page Yesterday at 07:13:26 AM