four digit year

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: FourthWorld, heatherlaine, Klaus, kevinmiller

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: four digit year

Post by francof » Wed Mar 02, 2016 12:06 pm

Hi Jaque,

your function works on windows but, I want o use my app also on android and this environment is the only one where "useSystemDate " do not works.

best
franco

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: four digit year

Post by francof » Wed Mar 02, 2016 12:52 pm

so to verify if the date is correct I have done this,
starting by a date format dd/mm/aaaa
transform it in mm/dd/aaaa
and then convert it in dateitems

Code: Select all

   put  fld "fldData" into tData
   
   set itemdel to "/"
   put item 2 of tData into tMM
   put item 1 of tData into tGG
   put item 3 of tData into tAAAA
   put tMM & "/" & tGG & "/" & tAAAA into tDataMmGgAaaa
   
   convert tDataMmGgAaaa to dateItems  --test if date
   if the result = empty then
   else 
      beep
      answer warning "Attenzione, la data inserita non è valida!"  --the result (ritorna il msg "invalid date"
      exit to top
   end if
ciao
franco

Post Reply