Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Suitable way to send date& time to Database and retrive using JSP

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All, am new in jsp; I have a project in jsp.
I want to set a date and time calendar in an input box and send to my Database(Mysql) in XAMPP platform
in the format YYYY-MM-DD HH:mm later view the date and time from the database.

kindly, in need of your help...
Thanks!!
 
Ranch Hand
Posts: 99
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gerald,

You can show in your input in one way and when you submit your form, you get the parameter and can change the format the way you need to send you db.

-Mauro.
 
Sheriff
Posts: 67592
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the type of the column in which the date will be stored? Most often a DATETIME or TIMESTAMP type is used in which case you would convert the string parameter to a Date type to send th the DB.

You might also need to do some timezone massaging to store the value as UTC if that's what is expected. Otherwise the DB assumes the timezone of the DB server.
 
Gerald Leonard
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a form with an input which I want to put date
using calendar and send it to database and retrive later;
but I have no Idea how to go about..

please any help!!!
 
Mauro Trevigno
Ranch Hand
Posts: 99
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use HTML 5.

<input type="date" name="bday" max="1979-12-31">

Or some external API like Jquery datepicker.
 
Bear Bibeault
Sheriff
Posts: 67592
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You still haven't answered my questions.
reply
    Bookmark Topic Watch Topic
  • New Topic