Source language: Translate to:

[DateShort] not internationally formatted?

General questions about NeoBook

Moderator: Neosoft Support

[DateShort] not internationally formatted?

Postby Odd » Thu Aug 14, 2014 5:41 am

Seems like the global variable [DateShort] no longer is formatted according to the international settings of Windows (7, 64-bits). I'm running NB 5.8.5b.

I'm getting 8/14/2014 whereas the Norwegian format is 14.08.2014

Anyone who can confirm this?
User avatar
Odd
 
Posts: 81
Joined: Sat Apr 02, 2005 3:34 am
Location: Norway

Re: [DateShort] not internationally formatted?

Postby Gaev » Thu Aug 14, 2014 7:57 am

Odd:

I am using NeoBook 5.8.4 Professional (17 April 2013) under Windows XP ... I tried this ...

Code: Select all
AlertBox "Date Short" "[DateShort]"

... and I got the correct response ... 14/08/2014 ... which is setting for Region called Canadian English.

Sorry, I don't have Windows 7 or a Norwegian OS.
User avatar
Gaev
 
Posts: 3733
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: [DateShort] not internationally formatted?

Postby Neosoft Support » Thu Aug 14, 2014 11:29 am

If I set my Region/Language to "Norwegian" in Windows Control Panel, NeoBook displays the short date as:

14.8.2014

Tested on Windows 7 Home Premium 64bit w/SP1.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: [DateShort] not internationally formatted?

Postby Neosoft Support » Thu Aug 14, 2014 11:47 am

Update: Actually, this is a known bug in Windows 7!

To fix open the Region/Language settings in Windows Control Panel and change to a different region other than Norwegian. Click Apply. Then go back and change it back to "Norwegian" click Apply.

For some reason simply selecting the region is not working. You need to select a different region click apply then select you region and apply again.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: [DateShort] not internationally formatted?

Postby Odd » Tue Aug 19, 2014 11:31 am

Thank you, Dave, for pointing me in the right direction. That did the trick for me personally and on my computer.

However, I can't expect my users to know or do this, so I expanded my code with a none Norwegian section to meet this problem. The code saves files with the current date (and a sequence number) as the file name.

Code: Select all
FileRead "[inifil]" "2" "[dato]"
SearchStr "." "[dato]" "[dato_N]" ""
      If "[dato_N]" "=" "0"
.none Norwegian date format
      StrParse "[dato]" "/" "[did]" "[junk]"
      SetVar "[rtInputVar1]" "[did1]"
      SetVar "[rtInputVar2]" "2"
      rtAddZeroToNumber
      SetVar "[did1]" "[rtResult]"
      SetVar "[rtInputVar1]" "[did2]"
      SetVar "[rtInputVar2]" "2"
      rtAddZeroToNumber
      SetVar "[did2]" "[rtResult]"
      FileWrite "[arkivdir]Arkiv_[did2][did1][did3]_[filnr].txt" "1" "[filinnhold1]"
      Else
.Norwegian date format
      StrParse "[dato]" "." "[did]" "[junk]"
      FileWrite "[arkivdir]Arkiv_[did1][did2][did3]_[filnr].txt" "1" "[filinnhold1]"
      EndIf
User avatar
Odd
 
Posts: 81
Joined: Sat Apr 02, 2005 3:34 am
Location: Norway


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron