BlackBerry Forums Support Community

BlackBerry Forums Support Community (
-   Developer Forum (
-   -   how to get time & date? (

shreeram 12-22-2009 09:04 AM

how to get time & date?

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

i can open using
i get the size using

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

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

Dougsg38p 12-22-2009 09:12 AM

How about FileConnection.lastModified() ?

long dtm = fc.lastModified()

Date dt = new Date(dtm)

dealchecker290 12-22-2009 10:52 AM

buddy you can check it from file manager.

shreeram 12-22-2009 11: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..........


shreeram 12-22-2009 11: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 12:30 PM

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 12:33 PM

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 02:18 AM

FileConnection fc =

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

Now on SD card there are Video Files like


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 08: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 03:02 AM.

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