converting a date to dateitems

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

converting a date to dateitems

Post by jalz » Wed Mar 18, 2015 11:32 pm

Hi Guys,

I need to find the day of week a particular date is in. Looking at the dictionary I found the command to convert field "fld_date" to dateItems with the 7th value the the numeric day I'm interested in.

The problem I have is that I want my app to cope with users entering dates in the format dd/mm/yyyy or mm/dd/yyyy. I plan to have a preferences file which will indicate the format of the date for a particular user which will be stored in in a global field. I know the convert command works when the date is entered in mm/dd/yyyy but fails when entered in the UK way. Apart from me writing some code to move the dd/mm around before I use the convert command, is there a quicker way to get the dateitems to evaluate if I know the user is entering in data in UK format or do I change the format of the date to mm/dd manually in a script and then convert.


Posts: 11730
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany

Re: converting a date to dateitems

Post by Klaus » Thu Mar 19, 2015 1:38 am

Hi jalz,

not sure, but can't you use "system date" to convert to dateitems from?
Know what I mean?
-> convert tUserDate from system date to dateitems



Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”