At 9:14 AM -0800 2/18/03, you wrote:
Is there a way to reliably get the day of the week from the longDate or systemDate? Across all regional settings?'the long date' returns a string & you can tear it out of that
I can do it in Flash, but was wondering if there is some Lingo property I'm not aware of.
-Phil
on getDayOfWeek
x = the long Date
old = the itemDelimiter
the itemDelimiter = ","
theDay = x.item[1]
the itemDelimiter = old
return theDay
end
put getDayOfWeek()
-- "Tuesday"
However - 'the long date' doesn't work well across languages -
you might need to add a case statement to change the extracted item
so it's easier to use the systemDate() with a base date as a reference
on getDay
baseDate = date( 2003, 1, 5 ) -- first Sunday of this year (it can be any Sunday in the past)
days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
return days[(the systemDate - baseDate) mod 7 + 1]
end
put getday()
-- "Tuesday"
hth
-Buzz
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
