Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


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



Advertisement
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
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
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
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
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
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
Mysql Date from Date
Mysql Date from Date       Mysql  Date from Date Time in Mysql return the Current  date...'. To grasp this example, we use date(current_trimestamp ( )) query that return
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
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 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 & Time
Date & Time  How to insert System Date & Time in MS-ACCESS using Java
Date & Time
Date & Time  How to insert System Date & Time in MS-ACCESS using Java
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
PHP Date
PHP Date  Hi, How to use PHP Date functions in my PHP program? Thanks   Hi, PHP Date functions is very handy. It is used to progracess, format and create date objects in PHP. There are many ways to use PHP Date
date function
date function  Write a JavaScript program to read a date from user and perform the following, if entered value is date then perform the following 1. Display the day no from the date 2. Display the year from the date 3. Display
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 Validation
Date Validation  Hi, I need Date Validation using java in spring framework. Please Anyone help me... Thanks in advance
Finding A Date
Finding A Date  My Frequency Start Date is 24-08-2012 My frequency end date - not defined Calculation Frequency is Weekly(Sunday) My calculation... the following date of sunday
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, like 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
Date prorblem
Date prorblem  HI all, i have date comming from one text file into string filed in java code. once the date is available in filed ( of type String... to insert the date into oracle DB. my code is as below: String DATEADDED
date validation
date validation  sir, pls provide date validation code in javascript..we want to include it into our master form..   Please visit the following link: http://www.roseindia.net/mysql/datevalidation.shtml
Date validation
Date validation  How to validate date in jsp? That is i have a textbox which will have the value from the date picker. How to validate the date that should be entered in a specified format?   Hi Friend, Please visit
date picker
date picker  where i have to kept javascript ,css files and images in eclipse... please tell me the location
Date comparison
Date comparison  Hi..i have developed an application in which i pop up a message by comparing the dates.the comparison is done by the current date and the date previously stored in the database.the database value is first
date program
date program  I have to differentiate my activities as todays... todays task if(dt==1){ //something to restrict date for today only using the 2variables else if(dt==10) //10days before task { //something to restrict date
php date function - Date Calendar
php date function  Hi, I am new to PHP. I am trying to get date from database. But, every time the date under 1970, it changes to 1970. Im totally confuced.thank u in advance. For example : database: date format
Java Date conversion - Date Calendar
Java Date conversion  How do I convert 'Mon Mar 28 00:00:00 IST 1983' which is a java.util.Date or String to yyyy/MM/dd date format in sql
 

 

 

DMCA.com