Hi Alessandro,

Joel already answered your question, so I'll digress a bit with a really
neat bit of "locale awareness" code that Andrew Martin posted a while back.

--Gregg

;-- From Andrew Martin

use [Months Index] [
    Months: system/locale/months
    forall Months [
        Index: index? Months system/locale/months
        do reduce [
            to set-word! join first Months "?" 'func [
                "Is Date this month?" Date [date!]
                ]
            reduce ['= Index 'Date/Month]
            ]
        ]
    ]

Month: func [Date [date!]][
    pick system/locale/months Date/month
    ]

use [Weekdays Index] [
    Weekdays: system/locale/days
    forall Weekdays [
        Index: index? Weekdays system/locale/days
        do reduce [
            to set-word! join first Weekdays "?" 'func [
                "Is Date this weekday?" Date [date!]
                ]
            reduce ['= Index 'Date/weekday]
            ]
        ]
    ]

Weekday: func [Date [date!]][
    pick system/locale/days Date/weekday
    ]

;-- Sample results

>> now
== 27-Sep-2001/18:43:41+12:00

>> september? now
== true

>> month now
== "September"

>> thursday? now
== true

>> weekday now
== "Thursday"


-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to