BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 12-22-2009, 09:04 AM   #1 (permalink)
New Member
 
Join Date: Dec 2009
Model: 8130
PIN: N/A
Carrier: just start..........
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question how to get time & date?

Please Login to Remove!

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..............
Offline  
Old 12-22-2009, 09:12 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

How about FileConnection.lastModified() ?

long dtm = fc.lastModified()

Date dt = new Date(dtm)
Offline  
Old 12-22-2009, 10:52 AM   #3 (permalink)
New Member
 
Join Date: Dec 2009
Model: 9500
PIN: N/A
Carrier: chrome
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

buddy you can check it from file manager.
__________________
holidays to orlando
Offline  
Old 12-22-2009, 11:06 AM   #4 (permalink)
New Member
 
Join Date: Dec 2009
Model: 8130
PIN: N/A
Carrier: just start..........
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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..
Offline  
Old 12-22-2009, 11:07 AM   #5 (permalink)
New Member
 
Join Date: Dec 2009
Model: 8130
PIN: N/A
Carrier: just start..........
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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..........
Offline  
Old 12-22-2009, 12:30 PM   #6 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

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.

Last edited by Dougsg38p : 12-22-2009 at 12:32 PM.
Offline  
Old 12-22-2009, 12:33 PM   #7 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

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.
Offline  
Old 12-23-2009, 02:18 AM   #8 (permalink)
New Member
 
Join Date: Dec 2009
Model: 8130
PIN: N/A
Carrier: just start..........
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!!!!!!!!!!!!!!!!!

Last edited by shreeram : 12-23-2009 at 02:20 AM.
Offline  
Old 12-23-2009, 08:19 AM   #9 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

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?
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.