How to change date format

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
BLOMASKY
Posts: 1473
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

How to change date format

Post by BLOMASKY »

I have a process that uses WITH to initialize some variables on a form, some are dates. How do i set the locale to MM/DD/YY?


Thanks

Bruce
customaware
Posts: 2405
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: How to change date format

Post by customaware »

Not sure what the issue is Bruce.

Normally you set the Attribute data format in the Attribute settings in the BO.

Additionally, I was under the impression that US Date format was the default.

However, I think you can also to this....

Right Click on Locale in the tree and select New.

Set Name to " Weird USA Format" and then check "Use this locale by default"
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
BLOMASKY
Posts: 1473
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: How to change date format

Post by BLOMASKY »

Evening Mark,

I defined a date field with the format as MM/DD/YY. In my Process I have
ENTER NEW BONAME WITH fromDate = '09/01/14' (and tried with 4 digit year also) and on the screen was jan 9th.

Is there a trick when using the "WITH" keyword?

Thanks
customaware
Posts: 2405
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: How to change date format

Post by customaware »

Bruce,

Haven't got the User Guide handy but try something like....

WITH AS_DATE(''09/01/14','mm/dd/YY')

Or something like that.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: How to change date format

Post by tford »

I would define a DATE type attribute in SystemSettings and use that attribute in your WITH clause. That also gives you the benefit of not having the date hard coded in your application in case you ever need to change it.
Tom - V8.8 build 3137 - MySql / PostGres
BLOMASKY
Posts: 1473
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: How to change date format

Post by BLOMASKY »

Tford: I am doing this in the Process since I will have to calculate the dates. (I will have to take todays date, go back a year, then add 91 days to that, etc.). While I am testing, just wanted to assign a date.


Mark, I added a locale with dates as default and that did not fix it. the "AS_DATE" did though.

Thanks
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: How to change date format

Post by tford »

Tford: I am doing this in the Process since I will have to calculate the dates. (I will have to take todays date, go back a year, then add 91 days to that, etc.). While I am testing, just wanted to assign a date.
You can easily add that calculation to the SystemSettings attribute both during testing and live operation. Simply add a SystemSettings rule to do the calculation, then in your process you can ensure that the calc is up to date by adding UPDATE SystemSettings to your process.
Tom - V8.8 build 3137 - MySql / PostGres
Post Reply