aspose file tools
The moose likes Java in General and the fly likes Question about Calendar Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Question about Calendar" Watch "Question about Calendar" New topic
Author

Question about Calendar

Gökhan Sakalli
Greenhorn

Joined: Apr 04, 2009
Posts: 20
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

Joined: Dec 06, 2010
Posts: 446

How are you performing the conversion?
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12921
    
    3

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?

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Gökhan Sakalli
Greenhorn

Joined: Apr 04, 2009
Posts: 20
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
Bartender

Joined: Aug 16, 2005
Posts: 12921
    
    3

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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Question about Calendar
 
Similar Threads
Java Calendar Dates
Java Calendar Dates
duplicate created in AUTO INCREMENT in mysql if its possible?
How can dateTime field format can be controlled ?
problem while inserting date field in oracle data base