BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-17-2009, 09:18 AM   #1 (permalink)
Knows Where the Search Button Is
 
krmlkr's Avatar
 
Join Date: Jul 2008
Model: 8320
PIN: N/A
Carrier: Airtel
Posts: 19
Post Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up How to get the device date & time format

Please Login to Remove!

Hi,

In my Blackberry application I want to change date format as I am changing the device date format.

How to get the device date format? Is there any direct API to get the same?
Offline  
Old 08-17-2009, 01:31 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

net.rim.device.api.i18n.SimpleDateFormat
__________________
My other Blackberry is a PlayBook.
Offline  
Old 08-18-2009, 01:49 AM   #3 (permalink)
Knows Where the Search Button Is
 
krmlkr's Avatar
 
Join Date: Jul 2008
Model: 8320
PIN: N/A
Carrier: Airtel
Posts: 19
Post Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

Thanx for your reply.
But how can i get the device date pattern using SimpleDateFormat?
Is there any code snap available?
Offline  
Old 08-18-2009, 11:08 AM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

I guess I don't understand your question. If you just want to format a date using the default system format, ie as selected by the user when they set up their locale, currency format etc, then use net.rim.device.api.i18n.DateFormat.getInstance(int style)

If you're asking how to find out what that particular format is exactly, I have to ask why you care? The DataFormat and its children very nicely hide that complexity from you.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 08-19-2009, 12:30 AM   #5 (permalink)
Knows Where the Search Button Is
 
krmlkr's Avatar
 
Join Date: Jul 2008
Model: 8320
PIN: N/A
Carrier: Airtel
Posts: 19
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx hrbuckley for your reply.
Your first point is correct & it will help me.
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.