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

Ask A Question

Stats

  • Questions 432k
  • Answers 432k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In the second case B can't be used in places… May 15, 2026 at 2:38 pm
  • Editorial Team
    Editorial Team added an answer TL;DR: Use single quotes and use two $ signs. The… May 15, 2026 at 2:38 pm
  • Editorial Team
    Editorial Team added an answer Before I match the username and password, I should check… May 15, 2026 at 2:38 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.