Alex
Alex

Reputation: 241

Date.ToString CulturalInfo doesn't work on some machines

I just started working with Arabic calendar and stumbled upon a problem.

I use this line to get the specific format of the string.

.ToString("d MMMM yyyy, H:mm", CultureInfo.GetCultureInfo(locale))

and on my dev machine, everything works fine!

enter image description here

but when I deploy it to a production server (virtual machine), something goes wrong and I get this:enter image description here

it means the code is the same, something goes wrong with my virtual machine.

What might it be? language packages or ... how can I fix it?

Upvotes: 0

Views: 96

Answers (1)

ScottishTapWater
ScottishTapWater

Reputation: 4806

This is a problem that I have experienced before.

It is likely a result of the culture/region settings on your VM being different from your development system.

If you make sure that these are the same, your problem should resolve itself, or you can hardcode which culture you would like to use.

Upvotes: 1

Related Questions