• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

system date

 
mou haj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i take out system date in java in any specified formatsay yyyymmdd or yy/mm/dd etc ... the format will be dynamic.Please help
Thanks
Moumita
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the java.text.SimpleDateFormat class. For example:
------------------
Miftah Khan
- Sun Certified Programmer for the Java� 2 Platform
- Sun Certified Web Component Developer for the Java� 2 Platform, Enterprise Edition
[This message has been edited by Miftah Khan (edited October 01, 2001).]
 
mou haj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi miftaf im getting the following error
------------------
reference to Date is ambiguous, both class java.util.Date in java.util and class java.sql.Date in java.sql match
probably occurred due to an error in /E-Recon/uploadsqltest.jsp line 41:
------------------------------------------
Please help
Moumita
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either use "new java.util.Date()" instead of "new Date()", or include the following import statement in your code: "import java.util.Date;".
------------------
Miftah Khan
- Sun Certified Programmer for the Java� 2 Platform
- Sun Certified Web Component Developer for the Java� 2 Platform, Enterprise Edition
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic