Teddy and Larry,
I ended up using:
#CreateDate(Mid(CDate,find("YEAR",CDate)+5,Find(",MONTH=",CDATE)-find("YEAR",CDate)-5),Mid(CDate,find("MONTH",CDate)+6,find(",WEEK_OF_YEAR",CDate)-find(",MONTH=",CDate)-5),Mid(CDate,find("DAY_OF_MONTH",CDate)+13,find(",DAY_OF_YEAR",CDate)-find("DAY_OF_MONTH",CDate)-13))#
Messy but it works.
Paul
-----Original Message-----
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Teddy R.
Payne
*Sent:* Thursday, April 26, 2007 12:43 PM
*To:* discussion@acfug.org
*Subject:* Re: [ACFUG Discuss] Parsing Date
Paul,
The data has many informative pieces in it.
Specifically, java.util.SimpleTimeZone gives you your time zone
considerations as explained:
http://72.5.124.55/j2se/1.5.0/docs/api/java/util/SimpleTimeZone.html
Now it has both sun.util.calendar.ZoneInfo and java.util.SimpleTimeZone. I
suspect this is to allow for backwards compatibility of time zones from java
versions 1.3-1.5.
I believe 1031295600000 is the number of milliseconds from 1970. Don't
quote me. =)
I would use list and struct manipulation to get the latter portion of the
code:
<cfscript>
/**
* Converts a delimited list of key/value pairs to a structure.
*
* @param list List of key/value pairs to initialize the structure
with. Format follows key=value.
* @param delimiter Delimiter seperating the key/value pairs.
Default is the comma.
* @return Returns a structure.
* @author Rob Brooks-Bilson ([EMAIL PROTECTED])
* @version 1.0, December 10, 2001
*/
function ListToStruct(list){
var myStruct=StructNew();
var i=0;
var delimiter=",";
if (ArrayLen(arguments) gt 1){
delimiter = arguments[2];
}
for (i=1; i LTE ListLen(list, delimiter); i=i+1){
StructInsert(myStruct, ListFirst(ListGetAt(list, i, delimiter), "="),
ListLast(ListGetAt(list, i, delimiter), "="));
}
return myStruct;
}
</cfscript>
<cfset iTime =
'[time=1031295600000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=
sun.util.calendar.ZoneInfo[id="America/Los_Angeles",offset=-28800000,dstSavings=3600000,useDaylight=true,transitions=185,lastRule=
java.util.SimpleTimeZone[id=America/Los_Angeles,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2002,MONTH=8,WEEK_OF_YEAR=36,WEEK_OF_MONTH=1,DAY_OF_MONTH=6,DAY_OF_YEAR=249,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=-28800000,DST_OFFSET=3600000]'>
<cfset iTime = ListGetAt(iTime,2,"]]")>
<cfset sTime = ListToStruct(iTime)>
<cfset cfDate =
createDate(sTime["year"],sTime["month"],sTime["day_of_month"])>
<cfdump var="#cfDate#">
On 4/26/07, Larry J. Morrow <[EMAIL PROTECTED]> wrote:
>
> Oops, I forgot we change to 1970 back around 2000 with all of the bios
> updates.
>
> Larry
>
> Paul Morton wrote:
>
> Larry,
> I did find that the Unix Time Stamp is from January 1, 1970 in one
> reference. I'm just going to write a routine to pull the Month Day and Year
> out and create a CF date.
> Paul
>
> -----Original Message-----
> *From:* [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED] <[EMAIL PROTECTED]>] *On
> Behalf Of *Larry J. Morrow
> *Sent:* Thursday, April 26, 2007 11:13 AM
> *To:* discussion@acfug.org
> *Subject:* Re: [ACFUG Discuss] Parsing Date
>
> Hi Paul,
>
> There is something out there and I have used it, but it escaping me
> right now. I thought it used the word equinox or 01-01-2900 or time in the
> instructions/help files. Try a few Google searches and see what comes back.
>
> I am pretty sure about the starting date.
>
> Larry
>
> Paul Morton wrote:
>
> Larry,
> I suspected that was the "time=103...." , but I wasn't sure of the
> start date. Guess I could calculate it.
> I was going to pull the YEAR, MONTH, and DAY_OF_MONTH out and create a
> date in CF.
> Just thought there may be a function or something available.
>
> Paul
>
>
> -----Original Message-----
> *From:* [EMAIL PROTECTED] [ mailto:[EMAIL PROTECTED] <[EMAIL PROTECTED]>] *On
> Behalf Of *Larry J. Morrow
> *Sent:* Thursday, April 26, 2007 10:40 AM
> *To:* discussion@acfug.org
> *Subject:* Re: [ACFUG Discuss] Parsing Date
>
> Hi Paul,
>
> I would check to see if this is a converted date showing the number of
> seconds since 01-01-1900. That was a format used by some systems to hold
> the date in a numerical format for easier and a more universal storage
> format.
>
> I used to do this on *nix systems all the time.
>
> I will look around but I do not have the reverse readily available.
>
> Larry
>
> Paul Morton wrote:
>
> Hi all. I have a small problem for which I'm hoping there is a simple
> solution.
> I am pulling a date from an Informix database using an undocumented Web
> Service and I am getting a date that looks like:
>
> [time=1031295600000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=
>
sun.util.calendar.ZoneInfo[id="America/Los_Angeles",offset=-28800000,dstSavings=3600000,useDaylight=true,transitions=185,lastRule=
>
java.util.SimpleTimeZone[id=America/Los_Angeles,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2002,MONTH=8,WEEK_OF_YEAR=36,WEEK_OF_MONTH=1,DAY_OF_MONTH=6,DAY_OF_YEAR=249,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=-28800000,DST_OFFSET=3600000]
>
> I need to get this into a CFML date format and I was about to start
> developing a parsing routine, and the thought occurred to me that someone
> might recognize this data format and have a ready made solution to parsing
> the date from this.
> Anybody have a quick solution, or should I just hard code a parser?
>
> Paul
>
> -------------------------------------------------------------
> To unsubscribe from this list, manage your profile @
> http://www.acfug.org?fa=login.edituserform
>
> For more info, see http://www.acfug.org/mailinglists
> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------
>
>
> -------------------------------------------------------------
> To unsubscribe from this list, manage your profile @
> http://www.acfug.org?fa=login.edituserform
>
> For more info, see http://www.acfug.org/mailinglists
> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------
>
>
> -------------------------------------------------------------
> To unsubscribe from this list, manage your profile @
> http://www.acfug.org?fa=login.edituserform
>
> For more info, see http://www.acfug.org/mailinglists
> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------
>
>
> -------------------------------------------------------------
> To unsubscribe from this list, manage your profile @
> http://www.acfug.org?fa=login.edituserform
>
> For more info, see http://www.acfug.org/mailinglists
> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------
>
>
> -------------------------------------------------------------
> To unsubscribe from this list, manage your profile @
> http://www.acfug.org?fa=login.edituserform
>
> For more info, see http://www.acfug.org/mailinglists
> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------
>
>
> -------------------------------------------------------------
> To unsubscribe from this list, manage your profile @
> http://www.acfug.org?fa=login.edituserform
>
> For more info, see http://www.acfug.org/mailinglists
> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------
>
--
Teddy R. Payne
Adobe Certified ColdFusion MX 7 Developer
Google Talk - [EMAIL PROTECTED]
Atlanta ColdFusion User Group - http://www.acfug.org
Atlanta Flash & Flex User Group - http://www.affug.org
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink <http://www.fusionlink.com>
-------------------------------------------------------------
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by FusionLink <http://www.fusionlink.com>
-------------------------------------------------------------