date problem

date problem

View Answers

November 14, 2008 at 11:51 PM

Hai,
Here is a code for you.
-----------------------------------------------------------------------------
public class extract {
public extract()
{
}
public static void main (String[] args)
{
String dat = "200912202334";
String date = dat.substring(0,4);
System.out.println("Year"+date);
System.out.println("Month"+dat.substring(4,6));
System.out.println("Date"+dat.substring(6,8));
System.out.println("Hour"+dat.substring(8,10));
System.out.println("Minute"+dat.substring(10,12));
}
}
-----------------------------------------------------------------------------
OUTPUT:
-------
Year2009
Month12
Date20
Hour23
Minute34
-----------------------------------------------------------------------------









Related Tutorials/Questions & Answers:
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 
Advertisements
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
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
date
date   how to insert date in database? i need coding
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
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
date
database table name birthday (DOB date); dob with DATE data type in database while...=d.getTime(); java.sql.Date date = new java.sql.Date(t); try { System.out.println(date); Class.forName("oracle.jdbc.OracleDriver"); con
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
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 format - Date Calendar
date format  how to convert dd-mmm-yyyy date format to gregorian... to convert date to calender. import java.util.*; import java.text.*; public...="19-Sep-2008"; DateFormat format ; Date date ; format = new
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
problem in onlinetest...
problem in onlinetest...  hi, my code getting the problem is ,when user leave a question then the server puts error... pls help me
Date Formay - Date Calendar
Date Formay  Sir, How to comapare two different date format in java.  Hi friend, Code to compare two different date import...)) System.out.print("Current date(" + new SimpleDateFormat("dd/MM/yyyy"). format
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
Date format - Date Calendar
Date format  Hi All, I am getting a date from database as a format 2010-15-07.I need to change it to 07/15/2010 and display it on my date field.Every time i need to check the format of the date field and make sure the correct
Date limit on Dojo Date picker - Date Calendar
Date limit on Dojo Date picker  Hi all, I am using dojo for date picker in my project. When user click on date text box, date picker will pop up. Using that component user can select date. Now I trying something different. I
problem in validation
problem in validation  sir/madam, i m using struts-1.3.10. i m getting a problem my properties file is not found.... while i hav configuired it in struts-config.xml file, likeADS_TO_REPLACE_1 thanks n regards himanshu
javascript problem
javascript problem  hi guys My problem is that I am using radio button for yes or no but i want to do that if I press yes button then enter... enter please help me this problem
convert current date into date format
convert current date into date format  How to get current date and convert into date format in Java or PHP
date convertion
date convertion  How to convert the string date format 23/11/2009 to original date format in asp.net
problem on strings
problem on strings  in string1 "123456 ABC DEF...",IN string2 "raveen". iwant to add string2 after 123456 in the first string based on index number.i need logic for this with out using StringBuffer concept. Thanks in advanace
Problem with loginbean.jsp
Problem with loginbean.jsp  http://www.roseindia.net/jsp/loginbean.shtml - I am getting an error in loginbean.jsp.There is some error regarding .What is hello in this? Also in this example how
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
Mysql Date from Date
Mysql Date from Date       Mysql  Date from Date Time in Mysql return the Current  date. Understand with ExampleADS_TO_REPLACE_1 The Tutorial illustrate
compilation problem
compilation problem  struts 2.0 : i have included all 5 jars in lib folder,but its giving compilation problem that package open symphony doesnot... havenot set the build path.if this is the problem then tell me how to set
compilation problem
compilation problem  struts 2.0 : i have included all 5 jars in lib folder,but its giving compilation problem that package open symphony doesnot... havenot set the build path.if this is the problem then tell me how to set
Problem with cookies
Problem with cookies  Hello All, i need jsp code for RememberMe module of login. i am facing problem with cookies. so please if any one could guide me please help and provide mme the exact code.   Please visit
problem with package
problem with package  Dear sir, i have created one java file with package com.net; and i compiled the program.it showing the .class file in " net" folder.The problem is i want to use that .class file in some other
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
Oracle9i Problem
Oracle9i Problem  Hi I have a problem in Oracle9i .I have... the table what i created .But after closing the SQL+ ,the problem started.When i... .....;.it is saying no rows are selected.Why the problem arised in not getting the data that i
Java Date
Java Date  Hi, What is the API for Date management in Java? How use the Java Date API for manipulating date object in Java? Provide some... of API for working with date and time objects in Java. You can also use third
Date Picker
Date Picker  "I want to set default calendar date when using datepicker. This date means auto-loaded date when the calendar appears. The default date is the current date. I want to change it. How could I do
problem with session.invalidate()
problem with session.invalidate()  i stuck by a line with "session.invalidate()", after user logout also by pressing the back button of the browser user is still able to navigate to his home page and able to view the session
JScrollBar Problem...
JScrollBar Problem...  Hello Sir/mam, Can i know how to use JScrollBar to JFrame without adding any JPanel to it.. i want to add JScrollBar Directly to JFrame... Please Provide me Simple Example so i can understand
problem on php
problem on php   l have five tables and build them as forms and link between them php and database and i want to build query between them plz help me soon   PHP MySQL Tutorials
URL problem
URL problem  Hi. I have created a webpage for my project website. in that i have used frameset to split the page. Now if i click any link in the page its navigating to the another page. but the problem is here in the url its
date print
date print  how can i print the date in jsp page in the following formate month-date-year. (example. march 8 2012
date print
date print  how can i print the date in jsp page in the following formate month-date-year. (example. march 8 2012
Date & Time
Date & Time  How to insert System Date & Time in MS-ACCESS using Java

Ads