08-29-2008 01:15 AM
Solved! Go to Solution.
08-29-2008 02:55 AM
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 DateTimeUtitlities class. Or you may calculate it by yourselft.
09-06-2008 01:38 PM
I'm working on cookie code and was expecting to find some group of methods
to take the expiriation date and convert it to a long for the netscape cookie file format ( as well as the obvious expiration test).
Is there a simple method or do I have to make a field array and do it a piece at a time? As far as that goes, it looked
like the string utilities parsed words and would choke on numeric data. Is there something, if needed, that breaks
a string on spaces into a String of words/numbers/symbolsgroups?
09-10-2008 10:31 AM
To answer my own question, it looks like the net.rim.device.api.io.http.HttpDateParse class does what
I need in parsing an http date into a long that can be used for cache control.
But, I'm not sure this can be used to generate http dates from a long and the format of Date.toString() didn;t
look right when I tried it.
09-11-2008 08:03 AM
I'm trying to convert a long into something like this,
expires=Fri, 03-Sep-2038 19:06:33 GMT
but I get something like this from Date.toString()
Wed Sep 10 15:06:56 America/New_York 2008
and it wasn't immediately obvious how to change the format without perhaps going through the field things. I thought there may be
a utility to convert long to the http format,
// We need to try an "If-modified-since" for normal caching,
// and of course we can handle background loading.
04-27-2009 05:17 AM
I have a doubht. IF i set the trial mechanism and store the date by executing system.currentmillis(), would i save the current system date?
if thats the case what wil happen if i store the date and then customer changes the date to a date previous to the stored date.that would make the trial mechanism worthless isnt it? whats the work around? thanks,.
04-27-2009 06:13 AM - edited 04-27-2009 06:15 AM
One more thought.
We can save the current system time while installing and every day we can even keep maintaining the current day on one more property. Hence, once the system passed a day and the user purposepully change the system date to old date, we can alert the user that the system date has been back-dated and exit the application.
But the bad side is, if the user changes his system to future date and came back to current date also, our application won't allow the user to use our application.
Any other efficient way to handle the Trial validation effectively?