BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   how to get time & date? (http://www.blackberryforums.com/developer-forum/214528-how-get-time-date.html)

shreeram 12-22-2009 08:04 AM

how to get time & date?
 
Hi,


i want to find out the time & date for video file saved in bb on SDcard.

i can open using
(FileConnection)Connector.open(file_name);
i get the size using
fcsize();

but how to get time & date..........???

Thanks in advance..............

Dougsg38p 12-22-2009 08:12 AM

How about FileConnection.lastModified() ?

long dtm = fc.lastModified()

Date dt = new Date(dtm)

dealchecker290 12-22-2009 09:52 AM

buddy you can check it from file manager.

shreeram 12-22-2009 10:06 AM

Hi Dougsg38p
thanks 4 reply but it throws exception.....


can u give me the othr way
or any example if u have will be more useful..........


thanks..

shreeram 12-22-2009 10:07 AM

Hi dealchecker290

can u tell me how to do that?

i don't know..?

might be its a basic, but sorry i don't know

plz tell me if u know..........

Dougsg38p 12-22-2009 11:30 AM

OK - you *do* understand that this is just a code snippet and not real working code, right? Did you look at the API docs for FileConnection?

Do you also know that your other thread (in BB dev forum) is also answered, same answer (not by me)?

"throws exception" is extremely unhelpful.

What exception is thrown, at what line? Please post your code.

Dougsg38p 12-22-2009 11:33 AM

Note to dealchecker290: this is the Java dev forum, and the question is related the Java API's, so your answer (although appreciated!) is not relevant to the question.

shreeram 12-23-2009 01:18 AM

FileConnection fc =
(FileConnection)Connector.open("file:///SDCard/BlackBerry/Videos/");

System.out.println("Video File Connection Store Open..........");

Now on SD card there are Video Files like

VID01
VID02
VID03

This details are from property of that video(manual look..........)
VID01 is of 10dec09

VID02 is of 15dec09

VID03 is of 20dec09

Now last date & time is for VID03 which i want to access thr' my application.......

How to do that???????????????

Hope u can help me!!!!!!!!!!!!!!!!!

Dougsg38p 12-23-2009 07:19 AM

fc.lastModified() returns the date/time as a long value. You pass this value to the Date class to create a Date object.

What part of this does not work?


All times are GMT -5. The time now is 01:21 PM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.