Well if you debug this you might just see that as I said is true.

 <input id="depDATE"
        name="depDATE"
        type="text"
        value="#dateformat(now(),'mm/dd/yyyy')#" />

If you always expect the default as mm/dd/yyy, and someone enters dd/mm/yyyy
you may end up with an invalid date, and your code might be trapping and
returning a default now(). There could be many reasons, for what is
happening.

If they are entering the date, then there should not be a problem, unless
the date is invalid how do you handle that. But what if they are leaving it
as a default date? The server will report 6-9 hours difference depending on
which part of the USA you are in.

As I said there are many reasons, but it will be the localisation of the
now() function running on the server in question that is the problem. As to
what point that is happening is upto you to find.


On 6/9/07, Les Mizzell <[EMAIL PROTECTED]> wrote:
>
> Andrew Scott wrote:
> > Because now() is server time...
>
> Not actually. The value DEFAULTS to now(), but anything can be entered
> and it still ends on storing as 1 day earlier even when a different date
> is entered.
>
> What I *haven't* tested yet is to see if there's a particular hour that
> this happens, but I'm playing with it now - doing a submission every
> hour and seeing what I get back. If it's something other than midnight
> and it's correct for a few hours, that'll give me a clue.
>
>
>
> > Very simple problem....
> >
> >
> >
> > On 6/9/07, Les Mizzell <[EMAIL PROTECTED]> wrote:
> >> I've got a site that's hosted in Guernsey (Island in English channel)
> >> with a form with date input fields. Pretty darned simple.
> >>
> >> <input id="depDATE"
> >>         name="depDATE"
> >>         type="text"
> >>         value="#dateformat(now(),'mm/dd/yyyy')#" />
> >>
> >> This form uses a web service to write to a MySQL database in the US.
> >> Also pretty simple:
> >>
> >> One the Guernsey side:
> >>
> >> <cfinvoke webservice="#request.cfcLOCATION#"
> >>           method="ENROLLMENT_ONE"
> >>          returnvariable="getMAX"
> >>           WSdepDATE="#form.depDATE#" >
> >>
> >> On the US side:
> >>
> >> <cffunction name="ENROLLMENT_ONE"
> >>            access="remote"
> >>            returntype="any"
> >>            hint="Add the initial enrollment record">
> >> <cfargument name="WSdepDATE" type="date" />
> >>
> >>
> >> And in my insert statement.
> >>
> >> <cfqueryparam cfsqltype="CF_SQL_DATE"
> >>               value="#WSdepDATE#" />
> >>
> >>
> >> Looks fine, right?
> >>
> >>
> >> BUT - the dates stored are one date off from the dates entered.
> >> Somebody enters 7/21/2007 and 7/20/2007 is getting written to the
> >> database.
> >>
> >> What tha?????
> >>
> >> Any ideas at all? There's a 6 hour difference between the servers in
> >> Guernsey and where the database lives in the US. Could that have
> >> anything to do with it?
> >>
> >> Ideas? Any at all?
> >>
> >>
> >>
> >>
> >>
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280526
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to