Page 1 of 1

Date Format Issues

PostPosted: Tue Jan 19, 2016 9:37 am
by HackinHoodLogicsTm
My regards to you all..

I have an issue changing the date from d/m/y to m/d/y

I tried with this process but does not work

Code: Select all
DefineVar "[nDate]" "Date" "mm/dd/yyyyy" "[MonthNum] / [DayNum] / [Year]"


But I will see the date still stored in the old format 19/01/2016
I want it to be stored in this way rather 01/19/2016

I also used the DbpPopupDateSelector and still no success...

Please any help will be appreciated. ..Thank You

Re: Date Format Issues

PostPosted: Tue Jan 19, 2016 10:36 am
by Gaev
HackinHoodLogicsTm:

You should have seen an error message advising you that the DefineVar command requires 5 parameters (you only have four) ... this works ...
Code: Select all
DefineVar "[nDate]" "Date" "mm/dd/yyyyy" "Global" "[MonthNum] / [DayNum] / [Year]"
AlertBox "nDate" "[nDate]"

Re: Date Format Issues

PostPosted: Tue Jan 19, 2016 11:06 am
by HackinHoodLogicsTm
DefineVar "[nDate]" "Date" "mm/dd/yyyyy" "Global" "[MonthNum] / [DayNum] / [Year]"
AlertBox "nDate" "[nDate]"


The above code still display the answer in this format

01/19/2016

instead of 19/01/2016

Am using windows 10 and i dont know if that's also cause of the issue...

Re: Date Format Issues

PostPosted: Tue Jan 19, 2016 11:25 am
by stu
Try:

SetVar "[d]" "![mm]/[dd]/[yyyy]"

I will see the date still stored in the old format

Dates get displayed as per your locale settings but stored depending on your rdbms. Dates on my db server get stored like 2016-01-19 15:23:00.000 but displayed on my frontends like 19/01/2016

On a sidenote MS Access expects you to handle dates between #'s, just in case.

Re: Date Format Issues

PostPosted: Tue Jan 19, 2016 11:45 am
by Gaev
HackinHoodLogicsTm:

The above code still display the answer in this format
01/19/2016
instead of 19/01/2016

In your DefineVar command, you are asking it to be defined as "mm/dd/yyyyy" ... so 01/19/2016 is the correct answer !!!

If you want [nDate] to contain 19/01/2016, then specify "dd/mm/yyyy" ... and supply the values in the corresponding format ...like this ...
Code: Select all
DefineVar "[nDate]" "Date" "dd/mm/yyyyy" "Global" "[DayNum] / [MonthNum] /  [Year]"
AlertBox "nDate" "[nDate]"

Am using windows 10 and i dont know if that's also cause of the issue...

So am I ... nothing wrong with the OS level.


@Stu:

He is NOT talking about how Databases (Access, mySQL etc.) handle dates ... just NeoBook.

Re: Date Format Issues

PostPosted: Tue Jan 19, 2016 11:59 am
by HackinHoodLogicsTm
Thanks to you all for your replies. .

@Gaev ♥ thanks soo much thats what I was actually looking for... 19/01/2016

I don't know why I actually got my self into Date mess.

Thanks to everyone who contributed to helping me...
★★★ :D :D :D★★★