Solved change date to other language (1 Viewer)

Akai90

Member
Local time
Today, 17:53
Joined
Feb 8, 2022
Messages
65
hai,

is there any code or format to change my date (dd mmmm yyyy) to malay language without change the region setting on pc ?

my pc is control by domain admin, so everytime i change the region setting to malay it will change back to default value.

so my option is to control the date language in ms access

i only need change date format to malay. example below.

1 january 2022 --> 1 januari 2022
1 june 2022 --> 1 jun 2022

hope u understand

thanks
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:53
Joined
Feb 28, 2001
Messages
27,122
The only way I can see to do that is to make a special function for that conversion because Access uses VBA and/or system date management routines. You can't change those either, and the regional settings are almost guaranteed to be system-wide in scope.

The SIMPLEST way I could see to do this is to (a) use the format template of dd-mm-yyyy so that you get numeric strings (b) write a function that, given dd-mm-yyyy input, would use SPLIT to take apart the three segments based on the "-" delimiter (c) create a switch or SELECT CASE statement to convert the month digits into your Malay month names, (d) reassemble the day string, your new Malay month name, and the year string to form the dd-mmmm-yyyy equivalent.
 

Akai90

Member
Local time
Today, 17:53
Joined
Feb 8, 2022
Messages
65
tq for reply

i new in access,

can u please show me simple code for convert data month to malay language

thanks
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:53
Joined
May 7, 2009
Messages
19,226
using sonic's function, you use:

FormatDateForLocale(Date, "ms", , "d MMMM yyyy")

for the format you showed on post #1
 

Akai90

Member
Local time
Today, 17:53
Joined
Feb 8, 2022
Messages
65
using sonic's function, you use:

FormatDateForLocale(Date, "ms", , "d MMMM yyyy")

for the format you showed on post #1
sonic's function ?
in access ? never heard about sonic function
can you show me example.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:53
Joined
May 7, 2009
Messages
19,226
here is the demo.
note that the textbox contains "text" not real date.
so i don't think you can use the function as "formatting" template
for data entry.
 

Attachments

  • DateFormatAPI.accdb
    672 KB · Views: 309

Akai90

Member
Local time
Today, 17:53
Joined
Feb 8, 2022
Messages
65
here is the demo.
note that the textbox contains "text" not real date.
so i don't think you can use the function as "formatting" template
for data entry.
my date store in table field.

so what code for that..
C#:
Me.Text0 = FormatDateForLocale(Date, "ms", , "dd MMMM yyyy")

this for vba right ?

what the code for convert from table field ? and show on report for more important because on report it will print out.

thanks
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:53
Joined
May 7, 2009
Messages
19,226
did you see the db i posted. did you Explore the query.
the answer are all there. i think everyone can understand that.
 

Akai90

Member
Local time
Today, 17:53
Joined
Feb 8, 2022
Messages
65
ok already did convert part

thanks for the support
 
Last edited:

Users who are viewing this thread

Top Bottom