sushil
date problem
1 Answer(s)      4 years and 7 months ago
Posted in : Java Beginners

View Answers

November 15, 2008 at 12:28 AM


Hi friend,

class DateExample
{
public static void main(String[] args)
{
String dat ="200912202934";
String year = dat.substring(0,4);
String month = dat.substring(4,6);
String day = dat.substring(6,8);
String hours = dat.substring(8,10);
String minutes = dat.substring(10,12);
System.out.println("Year : " + year);
System.out.println("Month : " + month);
System.out.println("Day : " + day);
System.out.println("Hours : " + hours);
System.out.println("Minutes : " + minutes);

}
}

For read more information on java visit to :

http://www.roseindia.net/java

Thanks









Related Pages:
Multi-Date Handling Problem
Multi-Date Handling Problem  In our project we are using Oracle 10g as our data base, the problem is that we are picking In-date & Out-date from a calendar and on the basis of that date we are checking that on that date some
date problem - Java Beginners
date problem  how to extract day,month,year hours ,second from a string date. Examples: String dat ="200912202934" from this string extract month ,year,date,hours,minute Please help me. Thanks in advance Sushil 
MySql date problem
MySql date problem  with a mysql query, how can you get records of previous week dynamically, starting from sunday and ending on saturday? I don't want records from current date, just the previous week
date problem - Java Beginners
date problem  how to extract day,month,year hours ,second from a string date. Examples: String dat ="200912202934" from this string extract month ,year,date,hours,minute Please help me. Thanks in advance Sushil 
date problem in sql server - SQL
date problem in sql server  select count(*) from xxxx_tbl where emplid="+emplid+" and work_dt=#"+work_date+"#"; work_date is in string ,Backend is sql server 2000.i am getting the date problem when using in jsp page.  
Date Time Problem In Jsp code - Development process
Date Time Problem In Jsp code  Hi Friends, By using this code , am storing date and time into msaccess database. But while retriving i want to get same date and time .send me code for that. SimpleDateFormat
Date format - Date Calendar
Date format  please convert dd-mmm-yy date format to gregorian calendar date format.  Hi friend, Code related your Problem: import...]); Calendar calendar = new GregorianCalendar(pdt); Date time = new Date
date - Date Calendar
date   hi, sir i am doing student details project in swing but i am not getting current date in jtextfield in date it is giving ambigious error... label=new JLabel("Current Date: "); JTextField text=new JTextField(15
date retriving
date retriving  my name is subbareddy.sir i was implementing attendance management .In this project i faced one problem that is when i print date stored in the database displays time with date.but i want print only date.please
Date related query - Date Calendar
Date related query  hi, m a new biginner of java.i m intrested... user using bufferedReader. how can i convert a string into a date object.pls... Date { public static void main(String ar[]) { Date d1=new Date
JSF Tomahawk date problem - Java Server Faces Questions
JSF Tomahawk date problem  hi i am working with jsf. I have one doubt reg Tomahawk input Date and Input calender tags. I am trying to get... full details with source code to solve the problem and visit to : http
Servlet problem
problem from last three month and now i hope rose india developers... connectivity code it works but problem is with servlet page. My servlet code...", id); Calendar c1 = Calendar.getInstance(); String DATE_FORMAT_NOW
How to display current date in textbox - Date Calendar
;% } This is my problem: I want to display current date in textbox...How to display current date in textbox  Hi guys, I'm really need your... Date(); var month = currentTime.getMonth() + 1; var day
Date Coding - JSP-Servlet
Date Coding  Hi Sir. i am creating one web application in which date is compared with specific date.i.e,When current date is reached to particular given date then a particular action should happened.For example imagine
date format - Java Beginners
date format  how to 45day in dd-mmm-yyyy date format.  Hi friend, Code to solve the problem : import java.util.Date; import...-yyyy", Locale.US); Date d = sdf.parse(timestamp); Calendar cal
Date operation - JDBC
Date operation  The same what i asked already.Still i didnt get the solution.I dont ve any problem while inserting data from jsp to database.My Doubt... the html text obj into sql Date obj?  Hi friend, registration
java yesterday - Date Calendar
java yesterday  And how to make date format DD/MM/YYYY,thank's  Hi friend, Code to help solve the Problem : import java.util.Date... static void main(String args[]){ Date todaysDate = new java.util.Date
Date - Java Beginners
Date  how to add 45day in dd-mmm-yyyy date format but not current date.please tell me the code   Hi friend, Code to solve the problem... { SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy", Locale.US); Date d
Date & TIme - Development process
Date & TIme  Hi, I asked to insert Date and Time to database with am pm. but u send only date. Already date is stored. but i want to store date with time. Hi Friend, To insert the date,use the following code in your
Displaying Date in jsp - JDBC
Displaying Date in jsp  I want to insert Date of birth of a person... to interact with database.My JSP code for inserting Date is below: String dateStr... SimpleDateFormat("dd-MM-yyyy "); Date result = formater.parse(dateStr
ask java - Date Calendar
to subtract a date, ex:i work since 2008/09/01 so i'am work until now 1 month 10... this problem? Thank's   Hi friend, Code to help calculate... { public static void main(String[] args) { Date date = new Date
Ask date difference
Ask date difference  Hello, I have a problem about how to calculate date, the result from this code is not complete , this is my code . please help...(); } } public void getDiffer(String dt1, String dt2) throws ParseException{ Date date1
continue java - Date Calendar
continue java  How to make a subtract date from jframe like jtexfield, data can input into jtextfied ? and how to get year, yesterday a have... having the problem. Thanks
date
date   how to insert date in database? i need coding
continue java - Date Calendar
continue java  and how to subtract date(day month year) form jframe... and source code where you having the problem. Thanks   Thanks for posting...(); } } }); } public void getDiffer(String dt1, String dt2) throws ParseException{ Date
java again - Date Calendar
me again. My problem is how we get result jtextfield2 from if jtexfield1 we... : Date now : jtextfield1 //jTexfield1=date now //we enter ,then result in jTextfield2 Date work : jtextfield2 This my Source
date
date  can u tell me how to calculate difference between a user provided date and the system date in java
date
date  can u tell me how to calculate difference between a user provided date and the system date in java
date
date  i want difference between the date entered in a jtextfield and the system date in java
Problem with Hibernate or 11g
on Created date column by using hibernate query language. The Problem is every...Problem with Hibernate or 11g  Hi I am using Hibernate and 11g in my project. The problem I am facing is I am executing a query from java class
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
date
date  how to insert date using html through the combobox
jeee - Date Calendar
J2EE Tomcat  I have a application developed in J2EE Tomcat ...now the problem is i wanted to create a login page which is not working perfectly.Please help with the piece of code. Thanks
Java - Date Calendar
Java  Sorry, i have a new message from you.maybe this code can help me, i will try first.Thank's, if a have a problem can you help me again
Date - Swing AWT
Date   sir i have one JSpinner and a textfield that will display the current month and year next to that there is another a Textfield for Date and Jspinner for Month and Textfield for Year my problem is 1.the specified
datetimepicker - Date Calendar
datetimepicker stylesheet problem  Hi every one i am getting a style sheet problem after select in the datetimepicker icon. I am not able to get the calendar in IE6.select fields after the datepikcer are highlighting
coding problem - Java Beginners
coding problem  hi! i declared date as date datatype in oracle now i need to retrieve date from database to my java code.how can i please help me... the date from the MySql database. For this we have create a table date(id,myDate
code problem - Struts
(SHEET_OPEN_SUCCESS); return af; } i have to retrive it by date if u take it as open.jsp in that we have to retrive it by date suppose date... the tables are two tables create table emp_times(loginid varchar(10),date date,logintime
coding problem - JSP-Servlet
coding problem  dear sir i m very new to JSP sir i m getting problem...; Date of Insatallation... d=new Date(); var date1=""; var dd; var mm; var yy; function
DATE
DATE  I have the following as my known parameter Effective Date... of calcultion starts My question is how to find the date of Thursday This cycle... the date of all the thursdays of the given year. import java.util.*; import
problem Scrolling jTable in scrollpane
problem Scrolling jTable in scrollpane  hi i get into a problem of scrolling jtable in scrollpane.Only horizontal scroll is working, vertical scroll...","DATE"}; colname=new Vector(Arrays.asList(head
problem Scrolling jTable in scrollpane
problem Scrolling jTable in scrollpane  hi i get into a problem of scrolling jtable in scrollpane.Only horizontal scroll is working, vertical scroll...","DATE"}; colname=new Vector(Arrays.asList(head
problem scrolling jtable
problem scrolling jtable  hi, i've to query the table thousand... TO PERSON","PURPOSE","IN TIME","DATE"}; colname=new Vector...); MAIN PROBLEM HERE'S M TABLE IS NOT PROPERLY SETTING IN SCROLLPANE...REPLY SOON
JSP:How to get year of system date - Date Calendar
JSP:How to get year of system date  Please tell me how to get year of system date; I am doing import java.util.*; Date d = new Date(); d.getYear... friend, code to solve the problem : import java.util.*; public class
JCombo Box problem
(); cmbweek.addItem("Select"); java.util.Date date; int j=1; for(int i=1;i<=days;i++) { date... = new SimpleDateFormat("EEEE"); String day=f.format(date
Form Processing Problem
and date. <%@ page import="java.io.*" %> <% //to get...="text" name="first_name"> <br /> Circular Date: <input type="text... where it will view the inputs taken like Circular Reference and date
arraylist problem - JSP-Servlet
("Date Range :"+dateRange); String cd... end) AS Total_Calls from sample1.dbo.check5 where convert(varchar(10),[date],101..._calls from sample1.dbo.check5 WHERE convert(varchar(10),[date],101) BETWEEN
arraylist problem - JSP-Servlet
my code once again only in which i m facing the problem. /* * To change...+"'to'"+ed1+"'"; System.out.println("Date Range :"+dateRange...) AS Total_Calls from sample1.dbo.check5 where convert(varchar(10),[date],101