Problem with Java date mask

Asked By 10 points N/A Posted on -
qa-featured

Hi everyone, I am using Java software. But I am facing a problem of using the Java date mask. For programming the date, I need it. Please give me some tips about it.

SHARE
Answered By 35 points N/A #158368

Problem with Java date mask

qa-featured

 

Hello
 
You can use this example as refferece:
 
import java.text.*;
public class Test
{
 
    public static void main(String args[])
    {
    try
    {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-DD");
    System.out.println(sdf.parse(args[0]).toString());
    }
                catch(Exception e)
    {
    e.printStackTrace();
    }
    }
}
You can change date format as you need. This is simple example. I hope I helped. Regards.
 

Related Questions