Results 1 to 9 of 9
- 12-11-2009, 12:06 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 48
- Rep Power
- 0
- 12-11-2009, 12:51 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
If you made a file then it got this method:
set the time to the new "last edited" timeJava Code:setLastModified(long time)
It should work..
- 12-11-2009, 12:52 PM #3
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
See the API docs SimpleDateFormat.
- 12-11-2009, 03:26 PM #4
Member
- Join Date
- Feb 2009
- Posts
- 20
- Rep Power
- 0
try
ORJava Code:System.out.println(" 1. " + now.toString());
Java Code:System.out.println("10. " + DateFormat.getDateTimeInstance( DateFormat.LONG, DateFormat.LONG).format(now));
- 12-11-2009, 03:28 PM #5
Member
- Join Date
- Feb 2009
- Posts
- 20
- Rep Power
- 0
for Timestamp
Java Code:public class MainClass { public static void main(String[] args) { java.util.Date today = new java.util.Date(); System.out.println(new java.sql.Timestamp(today.getTime())); } }
- 12-16-2009, 12:11 PM #6
Member
- Join Date
- Aug 2009
- Posts
- 48
- Rep Power
- 0
Hi,
Thanks for your replies, these all help me a lot :). I created date like this
And the output isJava Code:String pattern = "EEE MMM dd hh:mm:ss a z yyyy"; SimpleDateFormat format = new SimpleDateFormat(pattern); System.out.println(format.format(new Date()));
Wed Dec 16 04:31:03 PM GMT+05:00 2009
But i want that instead of GMT+05:00 it shows PKT means Pakistan time. All is fine only GMT+05:00 should be replace with PKT. How can i do it.
Thank you.
- 12-16-2009, 12:16 PM #7
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
reread reply #3
- 12-17-2009, 11:17 AM #8
Member
- Join Date
- Aug 2009
- Posts
- 48
- Rep Power
- 0
Hi,
Hope you all will be fine.I did, i also tried
but the GMT is still there and when i check the timezone it also gave me GMT instead of PKT any ways leave it.Java Code:System.out.println("10. " + DateFormat.getDateTimeInstance( DateFormat.LONG, DateFormat.LONG).format(now));
Now i also asked about the timestamps and Pansylea replied that try
But i got timestamp in the formJava Code:Date today = new Date(); System.out.println(new java.sql.Timestamp(today.getTime()));
2009-12-17 15:39:06.777
and i want it in the form like below
i.e., 10 character long.How can i do it.1225467987
Thank you.
- 12-17-2009, 11:37 AM #9
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Similar Threads
-
julian date to full date format
By judy318 in forum New To JavaReplies: 7Last Post: 11-02-2009, 12:17 PM -
Date Format
By learnspring in forum New To JavaReplies: 1Last Post: 11-16-2008, 05:16 PM -
how to convert date format
By saran123 in forum New To JavaReplies: 5Last Post: 10-16-2008, 06:10 PM -
Simple Date Format
By arimakidd in forum Java AppletsReplies: 1Last Post: 09-29-2008, 04:46 AM -
problems with Date format
By tommy in forum New To JavaReplies: 1Last Post: 07-25-2007, 08:38 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks