[wm21 - android] what out when assing value to ..day ..month ..year

Startbeitrag von ccc2 am 15.11.2016 04: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?

Antworten:

Hi ccc2, that's great!

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

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

Did you notify PC Soft Tech Support??

von GuenterP - am 15.11.2016 06:12
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

von Bart VDE - am 15.11.2016 07:35
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!

von GuenterP - am 15.11.2016 10:43
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.