• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

date conflict

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am entering system date ..

java.sql.Timestamp ApprovedOn= null;

java.sql.Timestamp currDate = UtilClass.getSystemDateTime();
ApprovedOn = currDate;


pstmt.setTimestamp(16, ApprovedOn);


At this time it is entering time perfectly.
like
3/31/2005 5:42:21 PM
But when i fetch this value it is showing time with AM.

Please Help me i am at Client side Very urgent.with code please

Thanks in advance
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you use Calendar class instance...
 
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

At this time it is entering time perfectly. like 3/31/2005 5:42:21 PM



How do you know? Do you print out the date from your program, or do you look in the database directly using some other tool?


But when i fetch this value it is showing time with AM.



Please show the code you use to fetch the date.
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vicky,

Without more info, this is impossible to diagnose, but as a wild stab in the dark, I'd suggest that something is not picking up the AM/PM string and reading the time as a 24 hour clock thing.

cheers, Pete
 
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic