Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 857957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:28:45+00:00 2026-05-15T08:28:45+00:00

!!IMPORTANT!! Solution found, you need to use a sql.timestamp. Although there are 2 problems

  • 0

!!IMPORTANT!!
Solution found, you need to use a sql.timestamp. Although there are 2 problems with the timestamp. First of all if you want to put an Date into an Timestamp you need to do: new Timestamp(date.getTime().getTime());
Kinda weird…

Also the months of a Timestamp start at 0, so january is 0. This means 23-02-2010 in Timestamp means 23-01-2010.

Thanks all.

!!IMPORTANT!!

I’ve got a question about Java with MySQL. I’ve made a table called “Reserveringen”.
This table got 5 columns as shown below. The 2nd and 3th column are both datetime types (made in Dreamcoder for mysql). But as you can see both ain’t showing any time. Even when I get them from the database with Java, it shows the time is 23:00:00 if I’m correct.

  Id    vanaf       tot     klant_idmachine_id
    9   12/3/2010   1/14/2011   6   29
    8   1/3/2011    1/14/2011   6   27
    2   1/14/2011   6/20/2010   6   9
    3   1/14/2011   6/20/2010   6   11
    4   1/14/2011   6/20/2010   6   19
    5   1/14/2011   6/20/2010   6   21
    6   1/14/2011   6/20/2010   6   23
    7   1/14/2011   6/20/2010   6   25
    1   1/14/3911   1/14/3911   6   5

Tableinformation from mysql:

reserveringen  
Field  Null  Type  Key  Default  Extra  
Id _  NO _  int(10) _  PRI _  _  _  
vanaf _  YES _  datetime _  _  _  _  
tot _  YES _  datetime _  _  _  _  
klant_id _  YES _  int(10) _  MUL _  _  _  
machine_id _  YES _  int(10) _  MUL _  _  _  

Any solutions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:28:46+00:00Added an answer on May 15, 2026 at 8:28 am

    Use timestamp then it’ll store date and time like this 2010-06-21 13:28:17

    java.util.Date today=new java.util.Date();
    Timestamp currentTimestamp=new Timestamp(today.getTime());
    PreparedStatement statement = dbConnection.prepareStatement("your query");
    statement.setTimestamp(1, currentTimestamp);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a solution for the really common but important issue that i am
I have a solution consisting of about 10 important DLL files which are developed
There is very important shortcut for "Basic Code Completion" in IntelliJ IDE which assumed
Is there any way to make this solution IE6 and IE7 compatible? http://jsfiddle.net/kirkstrobeck/sDh7s/1/ Pulled
There is a very strange problem with jQTransform and jQery 1.4.2. When I use
The problem We need to defend against a 'WAITFOR DELAY' sql injection attack in
I need some help in picking the 'right' solution for the following 'problem'. I
Important : Please see this very much related question: Return multiple values in C++
IMPORTANT EDIT: Sorry everyone, i made a big mistake in the structure. char *name;
An important property of really SOLID code is the fact that constructor calls do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.