1. Gregory Rusak
  2. PowerBuilder
  3. Monday, 1 April 2019 20:49 PM UTC

Hello,

I haven't found any reported issues with the isDate() function, so I'm posting here to see if others experience the same results before I submit this as an Appeon defect.

It appears that the isDate() function will return FALSE when the Windows date format is set to something other than dd-MMM-YYYY, or dd-MMM-YY or dd/mm/yyyy.

For example, if the Windows date format is set to dd-MMM-YYYY, then the following will return TRUE:

isDate('01-Apr-2019')

But if you change the Windows date format to something like mm/dd/yyyy, then the same function:

isDate('01-Apr-2019')

will return FALSE.

I've attached an .srd file that demonstrates this issue. All you have to do is change your Windows date format and open the datawindow in the painter.

This is happening in PowerBuilder 2017 R2 Build 1769

Please let me know what you find.

Kind Regards,

Greg

Attachments (1)
Gregory Rusak Accepted Answer Pending Moderation
  1. Tuesday, 2 April 2019 17:44 PM UTC
  2. PowerBuilder
  3. # 1

Additional Remarks:

We also just tested and have confirmed that while isDate('01-Apr-2019') will return FALSE when the Windows Date Format is set to something like mm/dd/yyyy, isDate('Apr-01-2019') and isDate('2019-Apr-01') will return TRUE still when the Windows Date format is set to something like mm/dd/yyyy. Very odd indeed!

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 2 April 2019 14:21 PM UTC
  2. PowerBuilder
  3. # 2

What Olan is saying is that it is only TRUE if the format of the string matches the currently assigned Windows date format.

 

 

Comment
  1. Gregory Rusak
  2. Tuesday, 2 April 2019 16:00 PM UTC
... but that isn't the case. It will return TRUE for isDate('01-Apr-2019') even when the Windows date format is set to dd/mm/yyyy. It seems though that any other format that doesn't start with the day portion first will return FALSE - so is this an Appeon defect?
  1. Helpful
  1. Roland Smith
  2. Tuesday, 2 April 2019 17:24 PM UTC
Submit a bug report so you can get an answer from internal support and possibly a fix.

I think that any string that the Date() function can correctly convert should be reported as true by IsDate, whether it matches the current format or not.
  1. Helpful
  1. Gregory Rusak
  2. Wednesday, 3 April 2019 23:47 PM UTC
You would think that, but engineering seems to think that the string should be in the Windows Date format - not sure why or how they came to that conclusion. Have a response in to them, hopefully they can resolve.
  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Tuesday, 2 April 2019 03:36 AM UTC
  2. PowerBuilder
  3. # 3

Maybe your example was a bit mixed up and the code is fine, but:

But if you change the Windows date format to something like mm/dd/yyyy, then the same function:

isDate('01-Apr-2019')


mm.dd.yy <> '01-Apr-2019', it shoud be '04/01/2019'.

 

Olan

Comment
  1. Gregory Rusak
  2. Tuesday, 2 April 2019 04:42 AM UTC
Hey Olan,

I'm not sure I'm following what you're trying to get at here. Windows date formatting should not have an impact on the isDate() function when the sting passed to the function is in fact a valid date.

Regards

Greg
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 1 April 2019 21:02 PM UTC
  2. PowerBuilder
  3. # 4

Hi Greg;

  There are three support tickets open for the IsDate() method not working properly. Two tickets related to input formatting - for example double-byte input:  "201/02/22". However, one ticket (#685) seems to me to be the same issue as you and is in the state of "fixing".

Regards ... Chris

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 2 April 2019 19:04 PM UTC
Hi Greg;

Yes, we got around this with my Canadian Federal government clients when I was an independent consultant. Many of the PB App's were sent out to various embassy's around the world where the host MS-Windows O/S regional settings were not like we use in North America. We got around various formatting and data export/import issues by having the PB App change the regional settings to North American when the App was "active" and restore the original regional settings when the App was deactivated and/or shutdown. If I recall correclty, this was all done via registry setting changes.

For example ...

RegistrySet( "HKEY_CURRENT_USER\Control Panel\International", &

"sShortDate", RegString!, ls_DateFormat)



Note: I have not tested this with Appeon PB and MS-Windows 10. Used to work in PB 12.x and W7.

HTH

Regards ... Chris
  1. Helpful
  1. Gregory Rusak
  2. Wednesday, 3 April 2019 23:48 PM UTC
Hey Chris, as I mentioned in the bug tracking system, I'm sure our customers would not be happy with us changing their Windows date format, regardless for how long.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 4 April 2019 01:46 AM UTC
I understand.

It was just a "work around" suggestion.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.