0
paradoxit created
Please can you advise how I can return a localized formatted date on the server side from an IApplicationService?
I can do this locally in Angular using moment.js but I want to format the server side date to export a PDF.
4 Answer(s)
-
0
Hi,
In your case it is better to return date values as string, otherwise ABP will normalize datetime values. You can convert datetime values to string using culture like this:
CultureInfo enUS= new CultureInfo("en-US"); datetime.ToString("d", enUS);
-
0
Hi ismcagdas,
Thank you for replying. I don't however know what the current logged in users culture is from the server side, how can I find this out?
Kind regards, David Hawkins
-
0
Hi,
You can get it from Current Thread's Culture or CultureInfo.CurrentCulture.
Thanks.
-
0
Thanks ismcagdas