• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Question about Calendar

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 448
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you performing the conversion?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic