This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about Calendar

 
Gökhan Sakalli
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I am trying to send a Calendar object as a parameter

For example i am trying to send

10th of Januarry 2010 11:47

and it sends 2011-01-10T09:47:49.000Z(This date was converted from java.sql.Date object to Calendar object)

When i try to send 10th of Januarry 2010(no hour or second, was converted from java.util.Date to Calendar object)

it sends 2011-01-09T22:00:00.000Z

Does not 2011-01-09T22:00:00.000Z mean 10th of Januarry 2010?

Thank you. BTW I'm in Turkey.
 
Sunny Bhandari
Ranch Hand
Posts: 448
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you performing the conversion?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15494
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "Z" at the end of those strings mean that they indicate a date and time in the UTC timezone. You are 2 hours ahead of the UTC timezone. When it's 9:47 in UTC, then it's 11:47 in your local timezone.

And 09-01-2011, 22:00 UTC is 10-01-2011, 00:00 in your local timezone.

If you still have a problem, then can you explain with some source code what exactly you are doing, why it doesn't do what you want, and what exactly you want to achieve?
 
Gökhan Sakalli
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That exactly is what the answer to my question is.

Thank you very much. I was looking for what T and Z means.

 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15494
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "T" is just a separator character to separate the date from the time.

Note that this is the standard ISO 8601 format for dates and times, which is used as a standard format in for example XML files.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic