Non-English dates

Jan Schenkel janschenkel at yahoo.com
Fri Sep 12 05:48:01 EDT 2003


--- FlexibleLearning at aol.com wrote:
> Two date questions...
> 
> I am trying to manipulate locale-independent dates
> by using dateItems, system weekdayNames and system
> monthNames. As I only have an English-based system,
> could any non-English system users help me out?
> 
> [1] Date format convert...
> 
> on mouseUp
>   put line 6 of the abbrev system monthNames into
> tMth # or pick a number 1-12
>   get (tMth & " 1, 2004") # or pick a year
>   convert it to dateItems
>   put it &cr& the result # Do you get "invalid
> date"?
> end mouseUp
> 
> 
> [2] Weekends...
> 
> I understand it is dangerous to assume that line 7
> of the system weekdayNames always refers to a
> Saturday and line 1 always refers to a Sunday.
> 
> If this is the case, how do we reliably identify
> weekend dates?
> 
> /H
> 

[1] is almost certain to break, as different languages
may have different sequences.
Example :
    August 1, 2004
Would be in Dutch :
    1 augustus 2004

Plus, if you don't specify a 'from' date-format, the
engine has to make a guess and may get it wrong
anyway.

[2] is practically impossible to detect on the basis
of names alone.

Why don't you let the engine do the work for you 
    convert x from system date to date
and then manipulate that data further ?

This allows you to extract all the date info :
    convert tDate from system date to dateItems
    # now you can grab item 7 for the weekday

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the use-livecode mailing list