Hi, iam new to jsp. actually my problem is with the format of date and time.Datea nad time stored in database are in hh:mm:ss format. but when i am displaying reports, nanoseconds are displaying. please give reason for this.
Neha290791
0
Newbie Poster
Recommended Answers
Jump to Posthai Neha290791,
could you post the code how you get the date data from database?
so that we try to give a way to solution
Jump to Post@Neha290791,
could you post structure of the table?
but you are talking about time column and you are displaying/getting that data by using rs.getString() instead of using rs.getDate()
so i need data type of open_time column of your table.
[modified]
Jump to Postyeah Neha290791,
if the data type is of date or datetime type
try to do as follows
first get the column value
your_date = rs.getDate("open_time");
then use SimpleDateFormat class to display the time as you like (as follows)
SimpleDateFormat formatter = new SimpleDateFormat("your_format_here"); …
All 9 Replies
radhakrishna.p
29
Posting Whiz in Training
Neha290791
0
Newbie Poster
radhakrishna.p
29
Posting Whiz in Training
Neha290791
0
Newbie Poster
radhakrishna.p
29
Posting Whiz in Training
Neha290791
0
Newbie Poster
Neha290791
0
Newbie Poster
radhakrishna.p
29
Posting Whiz in Training
radhakrishna.p
29
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.