[AccessD] Date Format Again

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Thu May 20 11:18:09 CDT 2004


Drew:

The date is encoded in three characters in the key - one for month, one for
day, one for year.  I encode it from mm/dd/yy because I'm an ethnocentric
American.  But the system may be shipped anywhere in the world where they
may be using little known date formats like dd/mm/yy.

So when I uncode the expiration date from the key I have to know whether to
create an mm/dd/yy date or a dd/mm/yy date.  I think. (There's probably a
better way, but I don't know what it is.)

In the Taiwan case, they were using the (popular if common) American date
but had chosen yyyy-mm-dd for the short date format.  Which caused another
problem.

So now I'm thinking that instead of assembling the expiration date I could
just keep the month, day, and year in separate strings and use date serial
to compare to the date serial of the system date?  Is that where you're
trying to lead me?  Like:

DateSerial(varExpireYear, varExpireMonth, varExpireDay) <
DateSerial(DatePart("yyyy",Date), DatePart("m",Date), DatePart("d",Date)

?

Regards,

Rocky Smolin
Beach Access Software
http://www.e-z-mrp.com


----- Original Message ----- 
From: <DWUTKA at marlow.com>
To: <accessd at databaseadvisors.com>
Sent: Thursday, May 20, 2004 8:53 AM
Subject: RE: [AccessD] Date Format Again


> Again, why Rocky?  A date is a date.  If you are 'encoding' it, you know
the
> format you have encoded it as.  So if you are encoding mm/dd/yy, and you
> want to compare it to the local date, then just use DateSerial.
>
> It doesn't matter what region you are in, you are setting the encoding to
> the format that you want, right?
>
> Drew
>
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Rocky Smolin -
> Beach Access Software
> Sent: Thursday, May 20, 2004 10:23 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Date Format Again
>
>
> Jim:
>
> One problem - I'm not using a regular date.  I'm assembling the date which
> is encoded in a key.  So to build the date, I need to know the format to
> construct it in - mm/dd/yy or dd/mm/yy.
>
> I then compare it to the system date to see if the license has expired.
>
> Rocky
>
> ----- Original Message ----- 
> From: "Jim Lawrence (AccessD)" <accessd at shaw.ca>
> To: "Access Developers discussion and problem solving"
> <accessd at databaseadvisors.com>
> Sent: Wednesday, May 19, 2004 6:04 PM
> Subject: RE: [AccessD] Date Format Again
>
>
> > Hi Rocky:
> >
> > Why do you not use this piece of code to check the date. It does not
> matter
> > what is the format of the date, in which region because a Day is still a
> > day, a Month is still a month and so on... The following code will
> translate
> > any date.
> >
> > if format(DateSerial(Year(Date), Month(Date), Day(Date)),"yyyymmdd") >
> > MyCutoffDate then...
> >
> > Just pick your required result format.
> >
> > HTH
> > Jim
> >
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Rocky Smolin -
> > Beach Access Software
> > Sent: Wednesday, May 19, 2004 8:06 AM
> > To: AccessD at databaseadvisors.com
> > Subject: [AccessD] Date Format Again
> >
> >
> > Dear List:
> >
> > I thought I had the date format problem solved but in Taiwan they use
the
> US
> > format but they've got their machines set to yyyy-mm-dd.
> >
> > The problem is that I have a license expiration date encrypted in a key
> and
> > so the routine that decodes the key yields (among other things) the
> > expiration date which I compare to the system date.
> >
> > So I guess I'm going to have to use an API to get the regional setting
for
> > short date format?  I've been mucking around in the Knowledgebase but
> can't
> > seem to find what I want.
> >
> > Does anyone know the format for retrieving this item?
> >
> > I guess I will have to use a Select Case on the short date format to do
> the
> > decryption to yield a short date in the local format.  And just add
cases
> as
> > I find more short date formats.
> >
> > MTIA,
> >
> > Rocky Smolin
> > Beach Access Software
> > http://www.e-z-mrp.com
> >
> > --
> > _______________________________________________
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> > -- 
> > _______________________________________________
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
>
> -- 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> -- 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com




More information about the AccessD mailing list