Welcome to Dream.In.Code
Become a Java Expert!

Join 150,386 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,106 people online right now. Registration is fast and FREE... Join Now!




date converter using substring and IndexOf

 
Reply to this topicStart new topic

date converter using substring and IndexOf

alaa198
3 Feb, 2008 - 02:41 PM
Post #1

New D.I.C Head
*

Joined: 3 Feb, 2008
Posts: 1

CODE
import java.util.*;

public class time
{
public static void main (String[] args)  
{
  Scanner kybd = new Scanner (System.in);
/*
Get user to input number of seconds
**/

int x;
System.out.println("Please Enter the date you wish to convert Ex:' January 30, 2008 '");
x = kybd.nextInt();



String s = year+"-"+e_month+"-"+date;

~edit: added code tags PB

anybody know how to use the to search for the comma using indexOf to find the piece that has the day number.

This post has been edited by PennyBoki: 3 Feb, 2008 - 06:28 PM
User is offlineProfile CardPM
+Quote Post

PennyBoki
RE: Date Converter Using Substring And IndexOf
3 Feb, 2008 - 06:34 PM
Post #2

system("revolution");
Group Icon

Joined: 11 Dec, 2006
Posts: 2,011



Thanked: 7 times
Dream Kudos: 500
Expert In: Java,C++,C

My Contributions
Hi, please when posting code code.gif Thanks.

Can you give an example of the format of the date?
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 05:01PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month