Hi,
Where I live it is Saturday, 8 February 2025. When I do this in the message box:
put the short date into d ;convert d to dateitems ; answer d
I get "2025,2,8,0,0,0,7"
The last item (7) says it is Sunday but it should be 6, Saturday.
Instead of short date I also tried the english date and the nternet date: all come out with 7 as day of week = Sunday.
Don't know if is related but I checked my date & time settings in Windows 10. It says that the first day of the week is Monday, so that should be 1 for Monday and 6 for Saturday, not 7.
I'm puzzled.
dateItems show wrong day of the week
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: dateItems show wrong day of the week
The Jewish week starts on Saturday night as soon as it gets dark. 

-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: dateItems show wrong day of the week
By default LC uses English time notation, allowing a means for consistent operations regardless of localized display formats.
If you want localized display formats see the useSystemDate property, which will alter the behavior of the convert command to take localized display into account, within the scope of the currently executing handler.
If you want localized display formats see the useSystemDate property, which will alter the behavior of the convert command to take localized display into account, within the scope of the currently executing handler.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: dateItems show wrong day of the week
Much as Richard points out, from the dictionary:Martin-HC wrote: ↑Sat Feb 08, 2025 4:23 pmHi,
Where I live it is Saturday, 8 February 2025. When I do this in the message box:
put the short date into d ;convert d to dateitems ; answer d
I get "2025,2,8,0,0,0,7"
The last item (7) says it is Sunday but it should be 6, Saturday.
Instead of short date I also tried the english date and the nternet date: all come out with 7 as day of week = Sunday.
Don't know if is related but I checked my date & time settings in Windows 10. It says that the first day of the week is Monday, so that should be 1 for Monday and 6 for Saturday, not 7.
I'm puzzled.
Sunday is day 1 to Lc, not Monday as your system settings indicate.Lc Dictionary wrote: Use the dateItems keyword with the convert command to store a date and/or time.
Comments:
The dateItems format is a comma-separated list of numbers:
* the year
* the month number
* the day of the month
* the hour in 24-hour time
* the minute
* the second
* the numeric day of the week where Sunday is day 1, Monday is day 2, and so forth
The dateItems does not change depending on the user's settings, so you can use it (or the seconds format) to store a date and time with a stack, in an invariant form that won't change.
Further, if you *do* set the useSystemDate to true, at the end of the handler it is in, it will convert back to it's default (false).

Re: dateItems show wrong day of the week
Thank you, bogs!