Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / General CF Topics / July 2008



Tip: Looking for answers? Try searching our database.

How do I work with dates from URL and POST?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RichieWhite - 31 Jul 2008 20:31 GMT
When I pass the same date from an <A> tag and a form <input> tag, the results
are different.
They look the same, but the URL variable isn't in the same format when you use
the result in a calculation.

See http://www.fishingguidenow.com/datetest.cfm

Please help me find a way to consistently calculate the results whether they
come from a form or a URL.
Ian Skinner - 31 Jul 2008 20:46 GMT
> When I pass the same date from an <A> tag and a form <input> tag, the results
> are different.
[quoted text clipped - 5 lines]
>  Please help me find a way to consistently calculate the results whether they
> come from a form or a URL.

I don't see a problem with the date values you are receiving from the
post and get data.

I note that you are adding one *month* to the received date to get
'tomorrow'.  That seems to be a bit more then tomorrow to me, but
otherwise it is working as coded.

The url example is missing <cfoutput> tags so the output is not rendered
for the value of the function, but I presume it will work the same as
the form test.
Ian Skinner - 31 Jul 2008 21:04 GMT
A second point to realize is that any data you get from a form, either
with get or post, is string data - *NOT* a date object.  It may look
like a date to us humans.  Many of ColdFusion's functions will do their
best to convert the string into a date.

But you are leaving a lot to chance if you are not converting specific
strings to specific dates.  Just remember that "2/10/08" is February
tenth 2008 to some, the second of October 2008 to others and maybe
February tenth or October second, 1908 to a few archaic types.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.