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 7073153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:53:43+00:00 2026-05-28T05:53:43+00:00

i have a form where user enters an ad start time and an ad

  • 0

i have a form where user enters an ad start time and an ad end time, the format of that time is “yyyy/mm/dd hh:mm:ss”, then this data is push to a database.

BUT when user enters “yyyy/mm/dd 12:00:00” or basically anything 12, when i use 24 it just doesnt work, the database shows 00:00:00 for when i enter 12. how do i prevent that from happening?

 SplashPageValue value = new SplashPageValue();
 SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");

 value.adStartDate = df.parse(fileUp.getString("adStartDate"));    
 value.adEndDate = df.parse(fileUp.getString("adEndDate"));

screenshots below:

the form

the form

what i see in database using SQuirreL

pic

  • 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-28T05:53:43+00:00Added an answer on May 28, 2026 at 5:53 am

    Your question is unclear, but I strongly suspect the problem is just that you’re parsing using the 12-hour clock. Change your format string to use HH instead of hh, and that may well just fix things:

    SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    

    You should also consider which time zone you want to use when parsing, mind you. Personally I prefer to use Joda Time for all date and time operations in Java – including for parsing/formatting, as SimpleDateFormat isn’t thread-safe, unlike Joda Time’s parsers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form, user enters some data then submits. Rather than a popup
I have a form that asks users to enter a start and end time
Have a form where a user can enter start date/time and end date/time for
I have a form that allows me to enter a user into my database.
I have a form that requires a physical address. Once the user enters the
I have a jsp form validate.jsp which contains 2 text fields where user enters
I have a form where a user can enter the number of students that
I have a TextBox in a Windows Form that allows a user to enter
I have a form that is used for data entry, and on one form
I have a form that is supposed to store some of its data into

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.