Incorrect format or value for date ( Exercise. 26. dxl course)

Hello,

Has anyone come across a dxl error with the Pizza example in the dxl training course?

Here it is cut down to minimum

DB  pizzaDB = create "Pizza box"
DBE oDateDBE = date(pizzaDB, 30, today, true)

void buttonCallback(DBE element)
{
    print "button callback"
      Date oDate = get(oDateDBE)

      print "haven't had a pizza since " oDate "\n"
}


DBE buttonDBE = button(pizzaDB,"Element", buttonCallback)
show(pizzaDB)

I get the error: (date is in Spanish)

button callback-R-E- DXL: <Line:7> incorrect format or value for date (jueves, 27 de marzo de 2014)

However if I make the following modification to oDateDBE

Date init = dateAndTime(today) 
DBE oDateDBE = date(pizzaDB, 30, init, true)

it works. but not for dateOnly(today) 

regards

Colm


MyDeveloerWorks - Thu Mar 27 07:27:14 EDT 2014

Re: Incorrect format or value for date ( Exercise. 26. dxl course)
kourosh - Thu Mar 27 16:29:55 EDT 2014

It's getting the date from your locale set in Windows Control Panel under the Region and Language settings. But even when I change my locale from English (US) to Spanish, the dialog displays correctly with the date in Spanish "jueves, 27 de marzo de 2014"  without any error like yours. What version of the DOORS client are you using? I tested this in DOORS 9.5.2.0.

Re: Incorrect format or value for date ( Exercise. 26. dxl course)
MyDeveloerWorks - Thu Mar 27 18:24:36 EDT 2014

kourosh - Thu Mar 27 16:29:55 EDT 2014

It's getting the date from your locale set in Windows Control Panel under the Region and Language settings. But even when I change my locale from English (US) to Spanish, the dialog displays correctly with the date in Spanish "jueves, 27 de marzo de 2014"  without any error like yours. What version of the DOORS client are you using? I tested this in DOORS 9.5.2.0.

Thanks for trying this.

I have 8.3 I have a user who want to use my script on that version. I can try again tomrrow with DOORs 9.5.2

 

I did make another test, using code from Mathias in an earlier post, which I will repeat here ( I also tried the months in Spanish)

{
Date d1 = date("2 November 2010", "dd MMMM yyyy")
Date d2 = date("3 November 2010", "dd MMMM yyyy")
 
print (d1 == d2) "\n"
print (d1 != d2) "\n"
print (d1 < d2) "\n".....

 

I did not get "false , true, true". I got the opposite, even with the formatting. This is completey breaking a script I want to use to extract changed  attribute data from different time periods.