Source language: Translate to:

Date Format Issues

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Date Format Issues

Postby HackinHoodLogicsTm » Tue Jan 19, 2016 9:37 am

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
I am proud to be a Neobooker!!!
www.neosoftware.com
Special Thanks To
Mr. David Riley
User avatar
HackinHoodLogicsTm
 
Posts: 120
Joined: Wed Aug 28, 2013 7:03 am
Location: Ghana

Re: Date Format Issues

Postby Gaev » Tue Jan 19, 2016 10:36 am

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]"
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Date Format Issues

Postby HackinHoodLogicsTm » Tue Jan 19, 2016 11:06 am

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...
I am proud to be a Neobooker!!!
www.neosoftware.com
Special Thanks To
Mr. David Riley
User avatar
HackinHoodLogicsTm
 
Posts: 120
Joined: Wed Aug 28, 2013 7:03 am
Location: Ghana

Re: Date Format Issues

Postby stu » Tue Jan 19, 2016 11:25 am

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.
Microsoft Access hater.
User avatar
stu
 
Posts: 318
Joined: Wed Aug 07, 2013 11:37 am

Re: Date Format Issues

Postby Gaev » Tue Jan 19, 2016 11:45 am

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.
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Date Format Issues

Postby HackinHoodLogicsTm » Tue Jan 19, 2016 11:59 am

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★★★
I am proud to be a Neobooker!!!
www.neosoftware.com
Special Thanks To
Mr. David Riley
User avatar
HackinHoodLogicsTm
 
Posts: 120
Joined: Wed Aug 28, 2013 7:03 am
Location: Ghana


Return to NeoBook Action Commands

Who is online

Users browsing this forum: Bing [Bot] and 2 guests