Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7785945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:20:13+00:00 2026-06-01T20:20:13+00:00

I have written a program for getting the system date. <%@page import=java.util.*,java.text.*%> <html> <body>

  • 0

I have written a program for getting the system date.

<%@page import="java.util.*,java.text.*"%>

<html>
<body>
<p>&nbsp;</p>
<div align="center">
<center>
 <table border="0" cellpadding="0" cellspacing
    ="0" width="460" bgcolor="#EEFFCA">

<tr>
 <td width="100%"><font size="6" color
 ="#008000">&nbsp;Date Example</font></td>

</tr>
<tr>
 <td width="100%"><b>&nbsp;Current Date 
 and time is:&nbsp; <font color="#FF0000">


 <%
 DateFormat formatter = new SimpleDateFormat("DD-MON-YY");
 String date = formatter.format(new java.util.Date());
 %>
<%=date%>
</font></b></td>
</tr>
</table>
</center>
</div>
</body>
< /html>

I am getting an error. Please let me know how to convert the system date to dd-MMM-YY format.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:20:14+00:00Added an answer on June 1, 2026 at 8:20 pm

    A pattern of special characters is used to specify the format of the date. This example demonstrates some of the characters. For a complete listing, see the javadoc documentation for the SimpleDateFormat class.

    Note: This example formats dates using the default locale (which, in the author’s case, is Locale.ENGLISH). If the example is run in a different locale, the text (e.g., month names) will not be the same.

    Format formatter;
    
    // The year
    formatter = new SimpleDateFormat("yy");    // 02
    formatter = new SimpleDateFormat("yyyy");  // 2002
    
    // The month
    formatter = new SimpleDateFormat("M");     // 1
    formatter = new SimpleDateFormat("MM");    // 01
    formatter = new SimpleDateFormat("MMM");   // Jan
    formatter = new SimpleDateFormat("MMMM");  // January
    
    // The day
    formatter = new SimpleDateFormat("d");     // 9
    formatter = new SimpleDateFormat("dd");    // 09
    
    // The day in week
    formatter = new SimpleDateFormat("E");     // Wed
    formatter = new SimpleDateFormat("EEEE");  // Wednesday
    
    // Get today's date
    Date date = new Date();
    

    Some examples:

    formatter = new SimpleDateFormat("MM/dd/yy");
    String s = formatter.format(date);
    // 01/09/02
    
    formatter = new SimpleDateFormat("dd-MMM-yy");
    s = formatter.format(date);
    // 29-Jan-02
    
    // Examples with date and time; see also
    // Formatting the Time Using a Custom Format
    formatter = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss");
    s = formatter.format(date);
    // 2002.01.29.08.36.33
    
    formatter = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss Z");
    s = formatter.format(date);
    // Tue, 09 Jan 2002 22:14:02 -0500
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a java program that is actually works as a gui to
i have written this code to convert the current system date and time to
I'm new to OpenGL. I have written a programm before getting to know OpenGL
I have written a program in VB6. When I compile it and send it
I have written a program that uses qhttp to get a webpage. This works
I have written this program, which sorts some ints using a functor: #include<iostream> #include<list>
I have written my program in python. It is written across seven files and
Visual Studio C++ 2008 / GCC 4.4.2 I have written a program to run
I have written some sample program and DLL to learn the concept of DLL
I have written a Python program to find the carrier of a cell phone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.