• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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
 
You got style baby! More than this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic