PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [wm21 - android] what out when assing value to ..day ..month ..year
[wm21 - android] what out when assing value to ..day ..month ..year
Iniciado por guest, 15,nov. 2016 05:43 - 3 respuestas
Publicado el 15,noviembre 2016 - 05:43
Hi,

What out when assign value ..day , .. month , ..year

if I want to assign 31 dec 2016

what the different from these 2 test

--- test 1 ---
m_date is date = today()
m_date..day = 31
m_date..month = 12
m_date..year = 2016
info(m_date)


--- test 2 ---
m_date is date = today()
m_date..year = 2016
m_date..month = 12
m_date..day = 31
info(m_date)


test1 will return 30 nov 2016 while test2 will return 31 dec 2016 .

interesting right?
Publicado el 15,noviembre 2016 - 07:12
Hi ccc2, that's great!

myDate..Day = 31
myDate..Month = 12
myDate..Year = 2016
Info(myDate)

My MyDate (WD 21) returns 20161230
[attachment 2218 MyDate.png]

Did you notify PC Soft Tech Support??
Publicado el 15,noviembre 2016 - 08:35
I assume when you first assign the day property, you get an invalid date (31/11/2016), and the day will be reset to the last day of the month (11), i.e. 30.
When you assign it the other way, first year, then month, then day, you didn't get this problem.

Regards,
Bart
Publicado el 15,noviembre 2016 - 11:43
Hi Bart, you're absolutely right!

I assigned the current date first, which is 20161115 then I assigned the day "31", which is illegal in November and is hard set to "30" therefore ...

Means: setting the day properties as the first one is dangerous business!