> RTFM? steady on ol' chap.

When is that *not* good advice?


> it's because of the manual that I've been having
> this headache.

Well... not really.  If you use the function the way it's documented to
work... no worries.  You can't justifiably get *too* uptight if it doesn't
work the way you personally decide it should do, on some sort of whim.
Even if it seems sensible to both of us.  We didn't write the function,
after all.

BUT.

Yeah... it *is* entirely reasonable to assume that - given similar
functions work a certain way - that other functions would work that way
too.  No disagreement there.
 
My entire response (then. now.) is simply devil's advocacy.  I - for the
most part - agree with you.


> 1) how do you get that date object from a form (string)? 
> a) CreateDate(year, month, day)?

Yes.  That's how I do it.


> perfect for 3 list boxes but I want to
> use ISO dates 

You're doing something like this:

<your UI>
Type a date like this yyyy/mm/dd: <input type="text" />
</your UI>

?

*Folly*.

Users can't read.
Users will - seemingly - go out of their way to data-entry the most
unlikely thing.
Don't trust users.

If you say something like this:

<your UI>
Type 'apple'.  Typing anything else will result in your system being
vaporised in a hell-like fury never before seen on Earth, and - lo - your
first-born will be smiten from this world and be eternally damned in the
inferno that is incessant 'Survivor' re-runs: <input type="text"
value="apple" />
</your UI>

Your user with be typing "grpaefriut" (sic), as soon as the keyboard will
allow them to.



So I think it's not very sensible to simply *suggest* that a user should
type a date in "ISO format".

A convenient aside:
I used to work for the organisation in NZ that accredited things like ISO
standards... and until today I didn't even *know* there was an ISO standard
for date formatting.


We use between three and six (optional time component) drop downs to select
date/time data.  Never a raw input.


> apart is one way people do this BUT (imho) IT'S A CRAP IDEA. I never had

Yep.  Letting it be entered in a single string *in the first place* is also
a CRAP IDEA.


> OR LSParseDateTime(date/time-string)?
> sorry, no ISO date masks supported

This is where your complaint should lie.

This function *doesn't work*.

It's a trivial difference to what you were originally raising, but it's
significant.


> 2) since CF is an untyped language, the "date/time object" is simply a
> string in a particular format ( {ts '2003-07-06 00:00:00'} ). I'm trying
> to avoid

I know what you mean.

But *is* it simply a specially-formatted string, or is CF doing a type
conversion when you ask a date/time object to display (which inherently
needs to cast it as a string).
 

> 3) change the function to choke on strings? yeah, I see your point but can
> you see mine that Dateformat didn't choke but LSDateFormat did?

I'm not suggesting CF's date-handling is perfect.  Oooh no.  I was simply
trying to knock you off your unjustly high horse, because you were misusing
that particular function.

> As it turns out, I am getting LSDateFormat to work using an ISO date,
> although you've now sown seeds of doubt that it is truly working.
> <cfset form.date = "1996-01-01">
> <cfset objDate = LSDateFormat(form.date, "yyyy-mm-dd")>
> <cfquery ...>

Just don't use a simple string when getting dates from the user: it's not a
user-friendly interface, because you're assuming they comprehend all the
date-oriented issues that you me, and CF have to consider.

Adam

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to