Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

new webutil_file.file_modified_date function format mask . WebUtilDateFormat applet param

juliojgsDec 15 2023 — edited Dec 15 2023

Today I got a bug, the kind that are waiting to happen.

I'm using webutil_file.file_modified_date to get the modified date of a local file when I upload it to database from forms.

If you read forms new features pdf, https://www.oracle.com/a/tech/docs/oracleforms-1221-newfeatures.pdf , this function is a nice new improvement for webutil , (btw, webutil_demo should add it and the epoch one in its files_wbp procedure ;)

FILE_MODIFIED_DATE Returns date/time as a string with the default format set to "dd-MMM-yyyy HH:mm:ss". To change the date format, add the applet parameter WebUtilDateFormat and include the desired format. Setting an invalid format will result in the default format being used.

@michael-ferrante-oracle if we are talking oracle format mask syntax, there is a typo there. Actually two typos: the default format is “dd-mon-yyyy hh24:mi:ss”

As you can see, for some reason this function returns the date in varchar2 format, which - once I realized the mask - I converted to date and everything seemed to be working fine. Something cringed me with this format mask when I harcoded it, but it was working ok … till now.

To_Date(webutil_file.file_modified_date(p_file_path),'DD-MON-YYYY HH24:MI:SS')

I have an user who is having an error, which only affects him and I cannot reproduce. After troubleshooting it, I found out this user has his windows computer in portuguese language. Still have to check , but I bet probably the conversion started failing in december, as october and november have the same “mon” mask in both langs.

Now, to fix it I supose I have to do modifying the applet parameter WebUtilDateFormat , something I should have done when added this feature to the form, as my cringe sense pointed me.

Where should I set this WebUtilDateFormat applet parameter? I tried formsweb.cfg but it seems to ignore it.

Also wonder, once I know how to set it … What other functions may be affected by this param?

Comments
Post Details
Added on Dec 15 2023
10 comments
266 views