[thesite] Tips Database

.jeff jeff at members.evolt.org
Wed Jul 25 16:35:09 CDT 2001


dean,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: Dean Mah
:
: Dammit!  #$!@$#$@!%  That's it, I quit!  I'm
: not getting paid enough to put up with this
: inconsistency!  >:(
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cute -- <shake type="finger" class="boney">now put down the gun</shake>

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: Guess I'll have to parse the evoltdate header
: then.  I hate doing that especially if the
: format changed in the middle.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

i looked at parsing that header awhile back.  i'm sure it'd be alot easier
in perl, but this is what i came up with:

i've got a struct of months which correctly references that months month
number based on the abbreviation:

<cfparam name="months" default="#StructNew()#">
<cfparam name="months.Jan" default="1">
<cfparam name="months.Feb" default="2">
<cfparam name="months.Mar" default="3">
<cfparam name="months.Apr" default="4">
<cfparam name="months.May" default="5">
<cfparam name="months.Jun" default="6">
<cfparam name="months.Jul" default="7">
<cfparam name="months.Aug" default="8">
<cfparam name="months.Sep" default="9">
<cfparam name="months.Oct" default="10">
<cfparam name="months.Nov" default="11">
<cfparam name="months.Dec" default="12">

i get the date from the header and extract the necessary pieces from it
(using list functions and space as the delimiter):

  year:   #ListGetAt(row, 4, " ")#
  month:  #months[ListGetAt(row, 3, " ")]#
  date:   #ListGetAt(row, 2, " ")#
  time:   #ListGetAt(row, 5, " ")#

the bitch is the time.  it's in a variety of formats so converting it to gmt
isn't going to be easy (without trying to write logic that accounts for
every known possibility).  here's a sampling from the test data i got to
work with:

Sun, 19 Nov 2000 16:47:28 -0300
Sun, 19 Nov 2000 16:47:28 +0500
Sun, 19 Nov 2000 16:47:28 +1300
Sun, 19 Nov 2000 16:47:28 +0500
Sun, 19 Nov 2000 16:47:28 -1000
Sun, 19 Nov 2000 16:47:28 +0300
Sun, 19 Nov 2000 16:47:28 +0100
Sun, 19 Nov 2000 16:47:28 -0200
Sun, 19 Nov 2000 16:47:28 +0900
Sun, 19 Nov 2000 16:47:28 +0800
Sun, 19 Nov 2000 16:47:28 CST
Sun, 19 Nov 2000 16:47:28 -1200
Sun, 19 Nov 2000 16:47:28 +0100
Sun, 19 Nov 2000 16:47:28 CST
Sun, 19 Nov 2000 16:47:28 -0200
Sun, 19 Nov 2000 16:47:28 +0600
Sun, 19 Nov 2000 16:47:28 -0300
Sun, 19 Nov 2000 16:47:28 +0500
Sun, 19 Nov 2000 16:47:28 +0600
Sun, 19 Nov 2000 16:47:28 -1000
Sun, 19 Nov 2000 16:47:28 +0800
Sun, 19 Nov 2000 16:47:28 CST
Sun, 19 Nov 2000 16:47:28 +0700
Sun, 19 Nov 2000 16:47:28 CST
Sun, 19 Nov 2000 16:47:28 +0300
Sun, 19 Nov 2000 16:47:28 +1000
Sun, 19 Nov 2000 16:47:28 -0800 (PST)

i'm guessing the cst in there reflects +/- 0000.

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/








More information about the thesite mailing list