• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java Date

 
Satyam Jaiswal
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a java standalone application, It uses Date dt = new Date(); for getting current date and store it in datebase. But sometimes it stores Date like 2021-08-27 17:53:28, 2012-05-28 21:00:17, 3300-12-15 15:25:46, 3006-12-02 05:45:55 or sometimes fails to store in database while trying to save 30062007-12-02 05:45:55.
It happens very rarely, so fail to distinguish the problem.
Please help me out if anybody had this problem or have something on the mind.

Thanks
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Satyam ecstasy",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted, often without warning

thanks,
Dave
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you have a bug somewhere in your code that stores or retrieves the date in the database.

Without more details (and perhaps a code listing of your code), it is very hard to give you any useful answer.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic