BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-28-2008, 11:41 PM   #1 (permalink)
Knows Where the Search Button Is
 
jeet.bhatt@spec-india.com's Avatar
 
Join Date: Aug 2008
Location: India
Model: 8100
PIN: N/A
Carrier: Vodafone - India
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Date comparison

Please Login to Remove!

i want to setup a trial period mechanism in my application...

pls tell how to capture system date and how to compare two date...i mean is thr any function in BB api for comparing date?

thnx
__________________
Jeet
ORG::SPEC India
Ahmedabad. India
Offline  
Old 08-29-2008, 03:05 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i use calendar for an easy configuration:
Code:
   Calendar c = Calendar.getInstance();
   c.set(Calendar.DAY_OF_MONTH, 31);
   c.set(Calendar.MONTH, Calendar.AUGUST);
   if (c.getTime().getTime() < System.currentTimeMillis())
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 09-02-2008, 07:18 AM   #3 (permalink)
Knows Where the Search Button Is
 
jeet.bhatt@spec-india.com's Avatar
 
Join Date: Aug 2008
Location: India
Model: 8100
PIN: N/A
Carrier: Vodafone - India
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Smile Solution !!

Hi all

here is the logic of comparing dates...regarding expiry date issue


Date values stored as long values.
Every long date representation is qty of milliseconds passed from 01 jan 1970 00:00.
To compare two dates just compare two long values.

When your application starts for the first time (when there is no saved expiration date) - calculate and save expiration date in persistent store.

One day length in milliseconds is represented via constant in DateTimeUtilities class. Or you may calculate it by yourselft.

this hint is provided by rafo...

thnx rafo...thnx simon also..
__________________
Jeet
ORG::SPEC India
Ahmedabad. India

Last edited by jeet.bhatt@spec-india.com : 09-02-2008 at 07:21 AM.
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

Vintage Acron P-4000 EEPROM Programmer for Spartan VI, AV-4000 Alarm System
$59.99
Vintage Acron P-4000 EEPROM Programmer for Spartan VI, AV-4000 Alarm System pictureST Micro M93C66-WMN6P Serial EEPROM M93C66 - NEW Qty 27
$18.49
ST Micro M93C66-WMN6P Serial EEPROM M93C66 - NEW Qty 27  pictureXicor X2864API-35 EEPROM IC - NOS Qty 3
$22.0
Xicor X2864API-35 EEPROM IC - NOS Qty 3  pictureTape of QTY 100 Microchip 93LC56A-I/OTG 2 KB Serial EEPROM TSSOP8 NEW
$30.0
Tape of QTY 100 Microchip 93LC56A-I/OTG 2 KB Serial EEPROM TSSOP8 NEW pictureAPPRX 200PC SMD 93C46 1K BIT SERIAL EEPROM LOT 128X8 - SOIC8
$9.95
APPRX 200PC SMD 93C46 1K BIT SERIAL EEPROM LOT 128X8 - SOIC8 picture






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